Skip to content

Instantly share code, notes, and snippets.

@juggy
juggy / Country and States.js
Created November 10, 2010 03:21
Collect country codes, names and states from yahoo geolocation service with underscore.js and jquery
window.Countries = {};
$.ajax({
url: "http://where.yahooapis.com/v1/countries",
data: {appid: "5mCqm._V34HyJ7CniyiCQq.oi8LjlbUnJ1ge4X36P9bpyyao2ey7xvS.mBb1jcAf69AzoQ--", format: "json"},
dataType: "json",
success: function(data){
var countries = _.map(data.places.place, function(country){
return {"name": country.name, "url": country.uri};
})
@wilhelm-murdoch
wilhelm-murdoch / JSONCountries.json
Created December 6, 2010 02:45
Here is a JSON object which contains a list of all countries and their associated abbreviations. Thought others might find this useful.
[
{"US":"United States"},
{"CA":"Canada"},
{"AF":"Afghanistan"},
{"AL":"Albania"},
{"DZ":"Algeria"},
{"DS":"American Samoa"},
{"AD":"Andorra"},
{"AO":"Angola"},
{"AI":"Anguilla"},
@bartek
bartek / international_calling_codes.json
Created March 24, 2011 16:24
List of countries by ISO name and their calling codes. No one should have to go through the torture of finding these, so hopefully someone finds this useful.
{"Canada": "+1", "East Timor": "+670", "Réunion": "+262", "Montenegro": "+382", "Mali": "+223", "Cambodia": "+855", "Switzerland": "+41", "Ethiopia": "+251", "Saudi Arabia": "+966", "Aruba": "+297", "Swaziland": "+268", "Argentina": "+54", "Cameroon": "+237", "Wallis and Futuna Islands": "+681", "Bahrain": "+973", "Korea, Democratic People's Republic of": "+850", "Mayotte": "+262", "Haiti ": "+509", "Bosnia and Herzegovina": "+387", "Micronesia, Federated States of": "+691", "Jordan": "+962", "United States": "+1", "United States Minor Outlying Islands": "+1", "Trinidad and Tobago": "+1-868", "Greece": "+30", "Burkina Faso": "+226", "Senegal ": "+221", "Cuba (Guantanamo Bay)": "+5399", "Guantanamo Bay": "+5399", "Togo": "+228", "Spain": "+34", "Liberia": "+231", "French Antilles": "+596", "Nepal": "+977", "Tanzania, United Republic of": "+255", "Martinique": "+596", "Hungary": "+36", "Christmas Island": "+61-8", "French Guiana": "+594", "Niue": "+683", "Monaco": "+377", "Chatham Island (New Zealand)": "+64",
@vitobotta
vitobotta / Importing posts from Wordpress into Jekyll.rb
Created March 26, 2011 22:50
The script I used to import posts from my Wordpress blog into a new Jekyll one.
%w(rubygems sequel fileutils yaml active_support/inflector).each{|g| require g}
require File.join(File.dirname(__FILE__), "downmark_it")
module WordPress
def self.import(database, user, password, table_prefix = "wp", host = 'localhost')
db = Sequel.mysql(database, :user => user, :password => password, :host => host, :encoding => 'utf8')
%w(_posts _drafts images/posts/featured).each{|folder| FileUtils.mkdir_p folder}
@MikeWills
MikeWills / states.json
Created April 11, 2011 19:47
Full list of US states. 2.35kb
{"states":{"state":[{"name":"Alabama","shortCode":"AL"},{"name":"Alaska","shortCode":"AK"},{"name":"American Samoa","shortCode":"AS"},{"name":"Arizona","shortCode":"AZ"},{"name":"Arkansas","shortCode":"AR"},{"name":"Armed Forces Europe","shortCode":"AE"},{"name":"Armed Forces Pacific","shortCode":"AP"},{"name":"Armed Forces the Americas","shortCode":"AA"},{"name":"California","shortCode":"CA"},{"name":"Colorado","shortCode":"CO"},{"name":"Connecticut","shortCode":"CT"},{"name":"Delaware","shortCode":"DE"},{"name":"District of Columbia","shortCode":"DC"},{"name":"Federated States of Micronesia","shortCode":"FM"},{"name":"Florida","shortCode":"FL"},{"name":"Georgia","shortCode":"GA"},{"name":"Guam","shortCode":"GU"},{"name":"Hawaii","shortCode":"HI"},{"name":"Idaho","shortCode":"ID"},{"name":"Illinois","shortCode":"IL"},{"name":"Indiana","shortCode":"IN"},{"name":"Iowa","shortCode":"IA"},{"name":"Kansas","shortCode":"KS"},{"name":"Kentucky","shortCode":"KY"},{"name":"Louisiana","shortCode":"LA"},{"name":"Maine"
@JeffreyWay
JeffreyWay / gist:1525217
Created December 27, 2011 21:29
Instant Server for Current Directory
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
@coderoshi
coderoshi / gist:3729593
Last active March 31, 2022 15:43
A Very Short Guide to Writing Guides

A Very Short Guide to Writing Guides

This is just a few thoughts on the topic of writing technical guides. This was intended for Basho's engineering team, but this may apply to open source projects in general.

Audience

It's commonly preached that the first step in writing is to identify your audience; to whom are you writing? This is the most well known, most repeated, and most overlooked step of writing in general and technical writing in particular. Take this document, for example. My audience is technical people who need to communicate technical information, and not teenagers, so I shy away from images of pop icons and memes. I use jargon and words like "identify" rather than "peep this".

Pronouns

@grevory
grevory / bootstrap-photo-with-caption.html
Created April 12, 2013 04:47
Simple markup for adding captions and credits to images with Twitter Bootstrap.
<style>
.thumbnail.with-caption {
display: inline-block;
background: #f5f5f5;
}
.thumbnail.with-caption p {
margin: 0;
padding-top: 0.5em;
}
.thumbnail.with-caption small:before {