This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* How to create a Javascript object and initialize its properties using dot notation (.) | |
*/ | |
var codejobs = new Object(); | |
codejobs.url = 'http://www.codejobs.biz'; | |
codejobs.twitter = '@codejobs'; | |
codejobs.getTwitter = function() { return codejobs.twitter; }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
000100 IDENTIFICATION DIVISION. | |
000200 PROGRAM-ID. HELLOWORLD. | |
000300 | |
000400* | |
000500 ENVIRONMENT DIVISION. | |
000600 CONFIGURATION SECTION. | |
000700 SOURCE-COMPUTER. RM-COBOL. | |
000800 OBJECT-COMPUTER. RM-COBOL. | |
000900 | |
001000 DATA DIVISION. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function cut($text, $length = 12, $type = "text", $file = FALSE, $elipsis = FALSE) { | |
if($type === "text") { | |
$elipsis = "..."; | |
$words = explode(" ", $text); | |
if(count($words) > $length) { | |
return str_replace("\n", "", implode(" ", array_slice($words, 0, $length)) . $elipsis); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function code($max = 10, $uppercase = TRUE) { | |
return ($uppercase) ? strtoupper(substr(md5(date("Y-m-d H:i:s", time())), 0, $max)) : substr(md5(date("Y-m-d H:i:s", time())), 0, $max); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function isSPAM($string, $max = 2) { | |
$words = array( | |
"http", "www", ".com", ".mx", ".org", ".net", ".co.uk", ".jp", ".ch", ".info", ".me", ".mobi", ".us", ".biz", ".ca", ".ws", ".ag", | |
".com.co", ".net.co", ".com.ag", ".net.ag", ".it", ".fr", ".tv", ".am", ".asia", ".at", ".be", ".cc", ".de", ".es", ".com.es", ".eu", | |
".fm", ".in", ".tk", ".com.mx", ".nl", ".nu", ".tw", ".vg", "sex", "porn", "fuck", "buy", "free", "dating", "viagra", "money", "dollars", | |
"payment", "website", "games", "toys", "poker", "cheap" | |
); | |
$count = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function browser() { | |
$browsers = array( | |
"Opera" => "(Opera)", | |
"Mozilla Firefox" => "((Firebird)|(Firefox))", | |
"Galeon" => "(Galeon)", | |
"Mozilla" => "(Gecko)", | |
"MyIE" => "(MyIE)", | |
"Lynx" => "(Lynx)", | |
"Netscape" => "((Mozilla/4\.75)|(Netscape6)|(Mozilla/4\.08)|(Mozilla/4\.5)|(Mozilla/4\.6)|(Mozilla/4\.79))", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function removeSpaces($text, $trim = FALSE) { | |
$text = preg_replace("/\s+/", " ", $text); | |
if($trim) { | |
return trim($text); | |
} | |
return $text; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function slug($string) { | |
$characters = array("Á" => "A", "Ç" => "c", "É" => "e", "Í" => "i", "Ñ" => "n", "Ó" => "o", "Ú" => "u", | |
"á" => "a", "ç" => "c", "é" => "e", "í" => "i", "ñ" => "n", "ó" => "o", "ú" => "u", | |
"à" => "a", "è" => "e", "ì" => "i", "ò" => "o", "ù" => "u" | |
); | |
$string = strtr($string, $characters); | |
$string = strtolower(trim($string)); | |
$string = preg_replace("/[^a-z0-9-]/", "-", $string); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function randomString($length = 6) { | |
$consonant = array("b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "v", "w", "x", "y", "z"); | |
$vocal = array("a", "e", "i", "o", "u"); | |
$string = NULL; | |
srand((double) microtime() * 1000000); | |
$max = $length / 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
selector { | |
filter: alpha(opacity=60); /* MSIE/PC */ | |
-moz-opacity: 0.6; /* Mozilla 1.6 and older */ | |
opacity: 0.6; | |
} |
NewerOlder