Skip to content

Instantly share code, notes, and snippets.

<?php
/*
* Created on Sep 28, 2009
* @author Neill Russell <[email protected]>
*/
if($argc < 2) die(sprintf("Usage: %s <MAGENTO_ROOT>\n", $_SERVER['SCRIPT_FILENAME']));
define('MAGENTO_DIR', realpath($argv[1]));
<?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;
<?php
$countries = Array(
'AF' => 'Afghanistan',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AG' => 'Antigua And Barbuda',
AFG | Afghanistan
ALB | Albania
DZA | Algeria
ASM | American Samoa
AND | Andorra
AGO | Angola
AIA | Anguilla
ATA | Antarctica
ATG | Antigua and Barbuda
ARG | Argentina
<?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>