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
# 삼성전자 => ㅅㅅㅈㅈ, 유안타제3호스팩 => ㅇㅇㅌㅈ3ㅎㅅㅍ | |
def extract_korean_initials(keyword) | |
initials = ['ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ'] | |
# hangul_range = '가'..'힣' | |
hangul_first = 44032 # '가'.ord | |
size = 588 # '까'.ord - '가'.ord | |
keyword.split('').collect do |k| |
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
#!/bin/sh | |
mkdir -p ~/Library/KeyBindings | |
echo '{ | |
"₩" = ("insertText:", "`"); | |
}' > ~/Library/KeyBindings/DefaultkeyBinding.dict |
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
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 |
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
/*cordova-deviceready-$q*/ | |
'use strict'; | |
angular.module('elcoCordova', []) | |
.factory('elcoCordova.onDeviceReady', [ | |
'$q', | |
'$log', | |
function ($q, console) { | |
console.log('elcoCordova.onDeviceReady'); | |
var deferred = $q.defer(); |
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
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 |
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
# 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)))); |
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
{ | |
"aar": | |
{ | |
"int":["Afar"], | |
"native":["Afaraf"] | |
}, | |
"aa": | |
{ | |
"int":["Afar"], | |
"native":["Afaraf"] |
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
# case 1 | |
module.exports = function (options) { | |
options.blah; | |
} | |
# case2 | |
module.exports = function () { | |
var options = require('../config.js'); | |
options.blah | |
} |
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
// 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 = { |