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
$(document).ready(function(){ | |
$.getJSON("http://twitter.com/statuses/user_timeline/YOUR_TWITTER_USERNAME.json?callback=?", function(data) { | |
$("#last-tweet").html(data[0].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
a2enmod rewrite |
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
<html> | |
<head> | |
<title>Using mb_convert_case</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
</head> | |
<body> | |
<?php | |
// PHP still have problems with unicode, so Multi Byte functions solve part of this problem. | |
// For more information: http://www.php.net/manual/en/ref.mbstring.php |
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 | |
/** | |
* Just a parse int function, like the parseInt(string) from Javascript | |
*/ | |
// If your PHP version is < 5.2, this is the solution: | |
function parse_int($string) { | |
$size_of_string = strlen($string); | |
for ($i = 0; $i < $size_of_string; $i++) { | |
if (is_numeric($string[$i])) |
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
#Paste in your .htaccess file, and the requests www.yoursite.com will be redirected to http://yoursite.com | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^yoursite.com$ [NC] | |
RewriteRule ^(.*)$ http://yoursite.com/$1 [L,R=301] |
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
a { | |
color:green; | |
-webkit-transition-property: color; | |
-webkit-transition-duration: 0.5s; | |
-webkit-transition-timing-function: linear; | |
} | |
a:hover { | |
color: red; | |
} |
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
string = 'my test' | |
string = string[::-1] | |
print string #tset ym |
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
RewriteEngine on | |
# rules | |
RewriteRule !\.(js|ico|txt|gif|jpg|png|css|rar|zip|jpeg|swf|xml|robots\.txt)$ index.php |
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
Python Erlang Description Erlang Example | |
--------+--------+-----------------------+---------------- | |
< < strictly less than | |
--------+--------+-----------------------+---------------- | |
<= =< less than or equal | |
--------+--------+-----------------------+---------------- | |
> > strictly greater than | |
--------+--------+-----------------------+---------------- | |
>= >= greater than or equal | |
--------+--------+-----------------------+---------------- |
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
$('table a').each(function(){ | |
$(this).parent().parent().click(function(){ | |
location.href = $(this).find('a').attr('href'); | |
}); | |
}); |
OlderNewer