blackatom’s tumblr

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<!-- DEFAULT COLORS -->
<meta name="color:Background" content="#fff"/>
<meta name="color:Title" content="#444"/>
<meta name="color:Description" content="#777"/>
<meta name="color:Post Title" content="#6498cc"/>
<meta name="color:Text" content="#444"/>
<meta name="color:Inline Link" content="#6498cc"/>

<meta name="color:Quote" content="#888"/>
<meta name="color:Quote Border" content="#6498cc"/>
<meta name="color:Quote Source" content="#555"/>
<meta name="color:Link Post" content="#c00"/>
<meta name="color:Conversation Background 1" content="#f4f4f4"/>
<meta name="color:Conversation Background 2" content="#e8e8e8"/>
<meta name="color:Conversation Border" content="#bbb"/>
<meta name="color:Conversation Text" content="#444"/>
<meta name="color:Date" content="#ccc"/>

<meta name="color:Date Block" content="#6498cc"/>
<meta name="color:Date Block Text" content="#bbd5f1"/>
<!-- END DEFAULT COLORS -->

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>black atom studio</title>
<link rel="icon" href="http://data.tumblr.com/avatar_36977fa6bad2_16.gif"/>
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://blackatom.tumblr.com/rss"/>
<meta name="viewport" content="width=800"/> <!-- iPhone -->

<style type="text/css">
body {
margin: 0px;
background-color: #000000;
font-family: 'Lucida Grande', Helvetica, sans-serif;
}

a {
color: #6498cc;
}

h1 {
width: 600px;
padding: 0px 100px 20px 100px;
margin: 50px auto 40px auto;
border-bottom: solid 1px #ccc;
text-align: center;
font: Bold 55px 'Trebuchet MS', Helvetica, sans-serif;
letter-spacing: -2px;
line-height: 50px;
position: relative;
}

h1 a {
color: #FFFFFF;
text-decoration: none;
}

h1 img {
border-width: 0px;
position: absolute;
right: 0px;
bottom: 10px;
width: 43px;
height: 23px;
}

div#content {
width: 420px;
margin: auto;
position: relative;
}

div#content div#description {
position: absolute;
right: -170px;
width: 160px;
text-align: right;
}

div#description {
font: normal 17px Helvetica,sans-serif;
line-height: 20px;
color: #777;
}

div#description a {
color: #777;
}

div#searchresultcount {
margin: 15px 0 30px;
text-align: center;
}

div.post {
position: relative;
margin-bottom: 40px;
padding-right: 20px;
}

div.post div.date {
position: absolute;
left: -260px;
text-align: right;
width: 230px;
white-space: nowrap;
font: normal 34px Helvetica, sans-serif;
letter-spacing: -2px;
color: #ccc;
text-transform: uppercase;
line-height: 35px;
}

div.post div.date div.date_brick {
float: right;
height: 30px;
width: 45px;
background-color: #6498cc;
color: #bbd5f1;
font: Bold 12px Verdana, Sans-Serif;
text-align: center;
line-height: 12px;
margin-left: 10px;
padding-top: 5px;
letter-spacing: 0px;
overflow: hidden;
}

div.post img.permalink {
width: 14px;
height: 13px;
border-width: 0px;
background-color: #000;
display: none;
position: absolute;
right: 0px;
top: 0px;
z-index: 10;
}

div.post:hover img.permalink {
display: inline;
}

div.post h2 {
font-size: 18px;
font-weight: bold;
color: #6498cc;
letter-spacing: -1px;
margin: 0px 0px 5px 0px;
}

div.post h2 a {
color: #6498cc;
text-decoration: none;
}

div.post div.caption {
font-size: 14px;
font-weight: bold;
color: #FFFFFF;
margin-top: 10px;
padding: 0px 20px 0px 20px;
}

div.post div.caption a {
color: #FFFFFF;
}

/* Regular Post */

div.post div.regular {
font-size: 12px;
color: #FFFFFF;
line-height: 17px;
}

div.post div.regular blockquote {
font-style: italic;
border-left: solid 2px #FFFFFF;
padding-left: 10px;
}

/* Quote Post */

div.post div.quote div.quote_text {
font-family: Helvetica, sans-serif;
font-weight: bold;
color: #888;
border-left: solid 5px #6498cc;
padding-left: 10px;
}

div.post div.quote div.quote_text span.short {
font-size: 36px;
line-height: 40px;
letter-spacing: -1px;
}

div.post div.quote div.quote_text span.medium {
font-size: 25px;
line-height: 27px;
letter-spacing: -1px;
}

div.post div.quote div.quote_text span.long {
font-size: 16px;
line-height: 20px;
}

div.post div.quote div.quote_text a {
color: #888;
}

div.post div.quote div.source {
font-size: 16px;
font-weight: Bold;
color: #555;
margin-top: 5px;
}

div.post div.quote div.source a {
color: #555;
}

/* Link Post */

div.post div.link a.link {
font: Bold 20px Helvetica, sans-serif;
letter-spacing: -1px;
color: #0747B6;
}

div.post div.link span.description {
font-size: 13px;
font-weight: normal;
letter-spacing: -1px;
color: #FFFFFF;
}

/* Conversation Post */

div.post div.conversation ul {
list-style-type: none;
margin: 0px;
padding: 0px 0px 0px 1px;
border-left: solid 5px #bbb;
}

div.post div.conversation ul li {
font-size: 12px;
padding: 4px 10px 4px 8px;
color: #444;
margin-bottom: 1px;
}

div.post div.conversation ul li span.label {
font-weight: bold;
}

div.post div.conversation ul li span.user_1 {
color: #c00;
}

div.post div.conversation ul li span.user_2 {
color: #00c;
}

div.post div.conversation ul li span.user_3 {
color: #0a0;
}

div.post div.conversation ul li.odd {
background-color: #f4f4f4;
}

div.post div.conversation ul li.even {
background-color: #e8e8e8;
}

/* Video Post */

div.post div.video {
width: 400px;
margin: auto;
}

/* Footer */

div#footer {
margin: 40px 0px 30px 0px;
text-align: center;
font-size: 15px;
font-weight: bold;
color: #FFFFFF;
}

div#footer a {
text-decoration: none;
color: #FFFFFF;
}

div#footer a:hover {
text-decoration: underline;
}

div#footer div#credit {
font: normal 13px Georgia, serif;
font-size: 13px;
margin-top: 15px;
}

.query { font-weight: bold; }

</style>
</head>
<body>
<h1>
<a href="/">black atom studio</a>
<a href="/rss"><img src="/themes/5/rss.gif" id="rss" alt="RSS"/></a>
</h1>

<div id="content">
<div id="description">
<div>
<div id="search">
<form action="/search" method="get">
<input type="text" name="q" value=""/>
<input type="submit" value="Search"/>
</form>
</div>

full website coming soon!
<p><a href="/archive">Archive</a></p>
</div>
</div>

<div class="post">

<div class="date">
<div class="date_brick">
Sep<br/>

24th
</div>
Wed
</div>

<a href="http://blackatom.tumblr.com/post/51501657/it-is-coming"><img src="/themes/5/permalink.gif"
class="permalink" alt="permalink"/></a>

<div class="regular">
<h2><a href="http://blackatom.tumblr.com/post/51501657/it-is-coming">it is coming</a></h2>
hello everyone. we are busy with our clients right now so the website launch will have to wait. we hope you understand! you can follow this blog with updates.
</div>

</div>

<div id="footer">

<div id="credit">
Powered by <a href="http://www.tumblr.com/"
target="_blank">Tumblr</a>
</div>
</div>
</div>
<!-- BEGIN TUMBLR CODE -->

<iframe src="http://www.tumblr.com/dashboard/iframe?src=http%3A%2F%2Fblackatom.tumblr.com%2F"
border="0" scrolling="no" width="278" height="25" allowTransparency="true"
frameborder="0" style="position:absolute; z-index:1337; top:0px; right:0px; border:0px;
background-color:transparent; overflow:hidden;" id="tumblr_controls"></iframe>
<!-- END TUMBLR CODE --></body>
</html>

source

set expire for files in apache

# Set far-future expiry for images, css, and js
# Remember that you MUST change the filename whenever you update these items!
<ifmodule mod_expires.c>
<filesmatch ".(jpg|jpeg|png|gif|js|css)$">
ExpiresActive on
ExpiresDefault "access plus 10 years"
</filesmatch>
<filesmatch ".(ico)$">
ExpiresActive on
ExpiresDefault "access plus 2 months"
</filesmatch>
</ifmodule>

source

gzip files in apache

# Gzip all text-based files
<FilesMatch ".(php|html|css|js)$">
SetOutputFilter DEFLATE
</FilesMatch>

source

Get php.ini location

php -i | grep php.ini

source

Embedding Fonts in AS3 – Assets Class

package
{
public class Assets
{
[Embed(source='fonts/arial.ttf',
fontName='Arial', unicodeRange='U+0010-U+007F,U+00C4,U+00D6,U+00DC,U+00E4,U+00F6,U+00FC,U+00DF',
mimeType='application/x-font-truetype')]
public static var ArialBold:Class;
[Embed(source='fonts/arialbold.ttf',
fontName='ArialBold', unicodeRange='U+0010-U+007F,U+00C4,U+00D6,U+00DC,U+00E4,U+00F6,U+00FC,U+00DF',
mimeType='application/x-font-truetype')]
public static var Arial:Class;
}
}

source

Convert NSImage to CVPixelBufferRef

- (CVPixelBufferRef)fastImageFromNSImage:(NSImage *)image
{
CVPixelBufferRef buffer = NULL;

// config
size_t width = [image size].width;
size_t height = [image size].height;
size_t bitsPerComponent = 8; // *not* CGImageGetBitsPerComponent(image);
CGColorSpaceRef cs = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
CGBitmapInfo bi = kCGImageAlphaNoneSkipFirst; // *not* CGImageGetBitmapInfo(image);
NSDictionary *d = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], kCVPixelBufferCGImageCompatibilityKey, [NSNumber numberWithBool:YES], kCVPixelBufferCGBitmapContextCompatibilityKey, nil];

// create pixel buffer
CVPixelBufferCreate(kCFAllocatorDefault, width, height, k32ARGBPixelFormat, (CFDictionaryRef)d, &buffer);
CVPixelBufferLockBaseAddress(buffer, 0);
void *rasterData = CVPixelBufferGetBaseAddress(buffer);
size_t bytesPerRow = CVPixelBufferGetBytesPerRow(buffer);

// context to draw in, set to pixel buffer's address
CGContextRef ctxt = CGBitmapContextCreate(rasterData, width, height, bitsPerComponent, bytesPerRow, cs, bi);
if(ctxt == NULL){
NSLog(@"could not create context");
return NULL;
}

// draw
NSGraphicsContext *nsctxt = [NSGraphicsContext graphicsContextWithGraphicsPort:ctxt flipped:NO];
[NSGraphicsContext saveGraphicsState];
[NSGraphicsContext setCurrentContext:nsctxt];
[image compositeToPoint:NSMakePoint(0.0, 0.0) operation:NSCompositeCopy];
[NSGraphicsContext restoreGraphicsState];

CVPixelBufferUnlockBaseAddress(buffer, 0);
CFRelease(ctxt);

return buffer;
}

source

Compile with Font Assets

mxmlc -default-background-color=#FFFFFF -default-frame-rate=25 -default-size 760 360 -includes+=Assets -output=bin/main.swf -source-path+=lib/as3corelib  -source-path+=src -source-path+=assets -verbose-stacktraces=true -warnings=true src/de/project/Application.as

source

jQuery Form Validation

//contact-form validation
$("form#contact-form").validate({
errorPlacement: function(error, element) {
//appends error message to the p tag of the form field
error.appendTo( element.parent("p") );
}
});

source

Reg Expresion

<?php
$string = "first.last@domain.co.uk";
if (preg_match(‘/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2}$/’,
$string))
{
echo "example successful.";
}
?>

source

array carrello php

class cart {

var $id = array();
var $qt = array();
var $vt = array();

}

source