Skip to content

Instantly share code, notes, and snippets.

<?php
$twit_user = 'andrei_md';
$url = 'http://twitter.com/users/show/'.$twit_user.'.json';
$twitter_user = json_decode(file_get_contents($url));
echo $twitter_user->status->text;
?>
<?php
// Usefull arrays from grafikart.fr
// World countries
var $countries = array(
'Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antarctica', 'Antigua And Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia And Herzegovina', 'Botswana', 'Bouvet Island', 'Brazil', 'British Indian Ocean Territory', 'Brunei', 'Bulgaria', 'Burkina Faso', 'Burundi', 'Cambodia', 'Cameroon', 'Canada', 'Cape Verde', 'Cayman Islands', 'Central African Republic', 'Chad', 'Chile', 'China', 'Christmas Island', 'Cocos (Keeling) Islands', 'Columbia', 'Comoros', 'Congo', 'Cook Islands', 'Costa Rica', 'Cote D\'Ivorie (Ivory Coast)', 'Croatia (Hrvatska)', 'Cuba', 'Cyprus', 'Czech Republic', 'Democratic Republic Of Congo (Zaire)', 'Denmark', 'Djibouti', 'Dominica', 'Dominican Republic', 'East Timor', 'Ecuador', 'Egypt', 'El Salvador', 'Equ
<?php
// Usefull arrays from grafikart.fr
// World countries
var $countries = array(
'Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antarctica', 'Antigua And Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia And Herzegovina', 'Botswana', 'Bouvet Island', 'Brazil', 'British Indian Ocean Territory', 'Brunei', 'Bulgaria', 'Burkina Faso', 'Burundi', 'Cambodia', 'Cameroon', 'Canada', 'Cape Verde', 'Cayman Islands', 'Central African Republic', 'Chad', 'Chile', 'China', 'Christmas Island', 'Cocos (Keeling) Islands', 'Columbia', 'Comoros', 'Congo', 'Cook Islands', 'Costa Rica', 'Cote D\'Ivorie (Ivory Coast)', 'Croatia (Hrvatska)', 'Cuba', 'Cyprus', 'Czech Republic', 'Democratic Republic Of Congo (Zaire)', 'Denmark', 'Djibouti', 'Dominica', 'Dominican Republic', 'East Timor', 'Ecuador', 'Egypt', 'El Salvador', 'Equ
# ************************************************************
# From an original post of jagoulard
# http://www.sqlfr.com/codes/TABLE-CODE-POSTAL-FRANCE_54487.aspx
# ************************************************************
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
<?php
// From http://www.loc.gov/standards/iso639-2/php/code_list.php
// Last update: 2013-02-14
// Using only the bibliographic (B) codes
$languages = array(
'aar' => "Afar",
'abk' => "Abkhazian",
'ace' => "Achinese",
<script type="text/javascript" src="http://www.google.com/jsapi?key={!$googleKey}"></script>
<script type="text/javascript" charset="utf-8">
google.load("jquery", "1.6.1");
google.load("jqueryui", "1.8.13");
google.load("maps", "3.x", { other_params:"sensor=false&language=ja" });
</script>
<?php
$countries =
array(
"ae" => "United Arab Emirates",
"ao" => "Angola",
"bf" => "Burkina Faso",
"bi" => "Burundi",
"bj" => "Benin",
"bw" => "Botswana",
<?php
$countries =
array(
"ae" => "United Arab Emirates",
"ao" => "Angola",
"bf" => "Burkina Faso",
"bi" => "Burundi",
"bj" => "Benin",
"bw" => "Botswana",
<?php
function country_dropdown ( $name="country", $top_countries=array(), $selection=NULL, $show_all=TRUE ) {
// You may want to pull this from an array within the helper
$countries = config_item('countries');
$html = "<select name='{$name}' id='{$name}'>";
$selected = NULL;
if(in_array($selection,$top_countries)) {
$top_selection = $selection;
$all_selection = NULL;
#Ruby
Area = '555' # My area code
Tz = -8 # Time zone (GMT-8)
# Speed dial entries. Format: "key" => "number"
Speeddial = {
'0' => '555-5555', # Home
'1' => '1 555 555-5555', # Another Number