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 'active_support/all' | |
| def korean_topic_marker(str) | |
| k = str[-1] # last one char | |
| return '는' if k.mb_chars.decompose.size < 3 # 종성이 없는 경우 | |
| return '은' | |
| end | |
| def korean_subject_marker(str) | |
| k = str[-1] # last one char |
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 | |
| } |