Skip to content

Instantly share code, notes, and snippets.

@DveMac
DveMac / ISO3166-1.alpha2.json
Created September 24, 2021 09:05 — forked from ssskip/ISO3166-1.alpha2.json
json of country codes (ISO 3166-1 alpha-2) and corresponding names
{
"AF": "Afghanistan",
"AX": "Aland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
"use strict";
// A function that wraps a given `React.DOM.input`-like component to
// apply formatting to the value for display purposes.
//
// Example:
//
// var RoundedInput = createFormattedInput(React.DOM.input, {
// set: Math.round,
// });
@DveMac
DveMac / static_server.js
Created June 29, 2012 10:59 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@DveMac
DveMac / 2.js
Created April 10, 2012 15:40 — forked from mxriverlynn/1.js
template cache
TemplateCache = {
get: function(selector){
if (!this.templates){ this.templates = {}; }
var template = this.templates[selector];
if (!template){
template = $(selector).html();
// precompile the template, for underscore.js templates
template = _.template(template);
@DveMac
DveMac / hack.sh
Created March 31, 2012 17:57 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#