Metadata that will be used across the application in various places can be cached using the application cache by using the JSON format and storing them as a javascript resource. Additional javascript code can be used while loading pages to include metadata from the javascript files and populate the combo boxes.
This file contains hidden or 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
hg st -nu | xargs rm |
This file contains hidden or 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
ssh-keygen -y -f ~/.ssh/xshyamx-keys.pem |
Instead of the user scrolling through the entire list the most recently used items are promoted to the top, so the user can simply choose from his/her MRU list. We can attach a listener to the submit event of the form containing the combo box that requires the MRU functionality and store the values on each submit. When the form/page is reloaded the data stored in the HTML5 storage can be read back to construct an MRU list of items that can be appended to the top of the combo box.
This file contains hidden or 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
import os | |
import json | |
import urllib2 | |
import hashlib | |
import argparse | |
import urlparse | |
import traceback | |
# configurable parameters |
This file contains hidden or 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
function colorMap(selectors) { | |
var a = [].map.call(document.querySelectorAll(selectors), function(v) { return v.innerHTML; }); | |
var cmap = {}; | |
a.reduce(function(p,c) { if ( c.indexOf('#') == 0 ) {cmap[p.toLowerCase()] = c;} return c; }); | |
return cmap; | |
} | |
var oldColors = colorMap('.cf div h1.f3,.cf div h2.f3'), | |
newColors = colorMap('.pvfl div h1,.pvfl div h2'), | |
colors = {}; |
This file contains hidden or 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
/* | |
* For http://chancejs.com/#todo - Better names | |
* Get national data from http://www.ssa.gov/oact/babynames/limits.html | |
* extract names.zip | |
* cat yob*.txt > all.csv | |
*/ | |
var fs = require('fs'); | |
var filename = 'all.csv', males = {}, females = {}; |
This file contains hidden or 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
git update-index --assume-unchanged [files] |
This file contains hidden or 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
curl http://169.254.169.254/latest/meta-data/public-hostname |
OlderNewer