View korean key bindings.sh
#!/bin/sh
mkdir -p ~/Library/KeyBindings
echo '{
"₩" = ("insertText:", "`");
}' > ~/Library/KeyBindings/DefaultkeyBinding.dict
View active_record_2_yaml.rb
require 'yaml'
def active_record_2_yaml(active_record)
hash = Array.wrap(active_record).as_json.reduce({}) {|memo, item|
memo["id_#{item['id']}"] = item
memo
}
hash.to_yaml
end
View cordova-deviceready-angular-$q.js
/*cordova-deviceready-$q*/
'use strict';
angular.module('elcoCordova', [])
.factory('elcoCordova.onDeviceReady', [
'$q',
'$log',
function ($q, console) {
console.log('elcoCordova.onDeviceReady');
var deferred = $q.defer();
View gist:54ba041b31d9536a8364
event-tracking.com|4webmasters.org|trafficmonetize.org|semalt.semalt.com|social-buttons.com|best-seo-offer.com|buttons-for-website.com|free-share-buttons.com|buttons-for-your-website.com
View hashids.extension.coffee
# hashids (https://www.npmjs.org/package/hashids) make to support encrypt/decrypt string, json.
hashIds = new Hashids(secret);
hashIds.encryptString = (str) ->
hashIds.encrypt([].slice.call(new Buffer(str)));
hashIds.decryptString = (encrypted) ->
new Buffer(hashIds.decrypt(encrypted)).toString()
hashIds.encryptJSON = (obj) ->
hashIds.encrypt([].slice.call(new Buffer(JSON.stringify(obj))));
View sidebar-isActive.js
angular.module('sidebar', [])
.controller('SidebarCtrl', function ($scope, $route) {
$scope.isActive = function (url) {
return $route.current.$$route.controller === $route.routes[url].controller;
}
});
View iso_639-2.json
{
"aar":
{
"int":["Afar"],
"native":["Afaraf"]
},
"aa":
{
"int":["Afar"],
"native":["Afaraf"]
View gist:4d1aee23511803202e90
# case 1
module.exports = function (options) {
options.blah;
}
# case2
module.exports = function () {
var options = require('../config.js');
options.blah
}
View angular-watch-translate.js
// watch - translate - assign other member of scope
// check out how it works at http://jsfiddle.net/SWe4r/1/
var app = angular.module('watcherApp', []);
app.controller('watcherController', function ($scope) {
$scope.source = 'aaaaaa';
$scope.foo = {
bar: 'aaa'
};
$scope.bar = {
View gist:7095440
log = (input) ->
Math.log(input) / Math.log(26)
getColName = (input) ->
temp = input
char = ''
result = ''
# temp -= temp / temp^power
# console.log power