Skip to content

Instantly share code, notes, and snippets.

View elegantcoder's full-sized avatar

Constantine Kim 김현진 elegantcoder

View GitHub Profile
// 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 = {
# case 1
module.exports = function (options) {
options.blah;
}
# case2
module.exports = function () {
var options = require('../config.js');
options.blah
}
{
"aar":
{
"int":["Afar"],
"native":["Afaraf"]
},
"aa":
{
"int":["Afar"],
"native":["Afaraf"]
@elegantcoder
elegantcoder / sidebar-isActive.js
Created July 30, 2014 05:02
sidebar-isActive.js
angular.module('sidebar', [])
.controller('SidebarCtrl', function ($scope, $route) {
$scope.isActive = function (url) {
return $route.current.$$route.controller === $route.routes[url].controller;
}
});
# 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))));
@elegantcoder
elegantcoder / gist:54ba041b31d9536a8364
Created June 19, 2015 17:44
GA Spam Hosts Pattern
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
@elegantcoder
elegantcoder / label-ui-like-placeholder-pw.html
Created July 14, 2012 16:06
입력 필드 내에 텍스트 표시 UI 의 예제 코드
<label for="ex1-pw-input" style="display:none;">비밀번호</label>
<input type="password" value="비밀번호" data-placeholder="비밀번호" id="ex1-pw-input" />
fCollection.on 'reset', (collection, opts) ->
# contents of opts
# {
# error: function (model, resp) {}
# parse: true
# success: function (resp, status, xhr) {}
# }
# +Includes 를 넣었습니다. 이것은 httpd.conf 에서 <Directory> 설정을 상속받아 Includes를 추가해주어야 하므로
# Options Includes 가 아니라  Options +Includes 입니다.
# .htaccess 를 사용하려면 <Directory> 에서 AllowOverride All 로 설정하세요.
AddOutputFilter INCLUDES .html
Options +Includes
@elegantcoder
elegantcoder / README.md
Created September 2, 2012 10:28
Not clear things

NOT Clear Things Across Browsers

  • 브라우저 별로 애매한 Front-end 코드 모음.