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
function colorThem ( domElement ) { | |
var green = parseInt ( ( domElement.text() / 100 ) * 255 ); | |
var red = 255 - green; | |
greenString = green.toString ( 16 ); | |
redString = red.toString ( 16 ); | |
if ( greenString.length == 1 ) greenString = '0' + greenString; | |
if ( redString.length == 1 ) redString = '0' + redString; | |
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
<script src="http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAEX95M5gKl7Nn_i4Mzl1TAhT4b5KCiYFj3ZfOJov1Qpq4YsRyghTrgMf7VDdXUg9oULkwfWhrlOumiQ" type="text/javascript"></script> | |
<script type="text/javascript"> | |
var map = null; | |
var geocoder = null; | |
function initialize() { | |
if (GBrowserIsCompatible()) { | |
map = new GMap2(document.getElementById("map_canvas")); | |
map.setCenter(new GLatLng(29.427394,-98.624654), 15); |
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
# Reset the panels in GNOME: | |
gconftool --recursive-unset /apps/panel | |
rm -rf ~/.gconf/apps/panel | |
pkill gnome-panel |
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 | |
preg_replace('/(?!^.?)[0-9](?!(.){0,3}$)/', '*', $credit_card_number); | |
?> |
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
UPDATE wp_posts SET post_content = REPLACE (post_content, 'oldlink', 'newlink'); |
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
function getJavaScriptDate(timestamp) { | |
var regex=/^([0-9]{2,4})-([0-1][0-9])-([0-3][0-9]) (?:([0-2][0-9]):([0-5][0-9]):([0-5][0-9]))?$/; | |
var parts=drink.post_date.replace(regex,"$1 $2 $3 $4 $5 $6").split(' '); | |
return new Date(parts[0],parts[1]-1,parts[2],parts[3],parts[4],parts[5]); | |
} |
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 formatDates( $dates ) { | |
$output = ''; | |
$month = ''; | |
$year = ''; | |
sort( $dates, SORT_NUMERIC ); | |
foreach ( $dates as $date ) { |
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 getHash( $n = '' ) { | |
if( $n == '' ) { | |
$n = rand(); | |
} | |
$codeset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
$base = strlen($codeset); |
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
CREATE TABLE IF NOT EXISTS `country` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`iso` char(2) NOT NULL, | |
`name` varchar(80) NOT NULL, | |
`nicename` varchar(80) NOT NULL, | |
`iso3` char(3) DEFAULT NULL, | |
`numcode` smallint(6) DEFAULT NULL, | |
`phonecode` int(5) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
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 removeEmptyHTML($html_replace="") { | |
while(preg_match("/<[^\/>]*>\s*<\/[^>]*>/", $html_replace)) { | |
$html_replace = preg_replace("/<[^\/>]*>\s*<\/[^>]*>/","",$html_replace); | |
} | |
return $html_replace; | |
} | |
?> |
OlderNewer