Skip to content

Instantly share code, notes, and snippets.

@goonoo
goonoo / ec2-buildimage.sh
Last active August 29, 2015 14:13
EC2 Build Image script
#!/bin/bash
PATH=path/to/images
IMAGE=Image-`date +%Y%m%d-%H%M`
AWS_ACCESS_KEY=AGWEGAWEGAWEGAWEG
AWS_SECRET_KEY=waWG#reH5452HE23raWy432%
echo "building image ${IMAGE}"
sudo ec2-bundle-vol -k /home/ubuntu/.ssh/id_rsa -c /home/ubuntu/keys/server.crt -u USER_ID -r x86_64 --no-filter
@goonoo
goonoo / aes256.coffee
Last active August 29, 2015 14:12
Performance test between RC4 and AES128 and AES256
crypto = require('crypto')
cipher_key = "awegohaewiot2#%@#A#()GAWJVZDz34t#$TJOP#A$TA"
cipher = (txt) ->
c = crypto.createCipher('aes-256-cbc', cipher_key)
crypted = c.update(txt, 'utf8', 'hex')
crypted += c.final('hex')
return crypted
@goonoo
goonoo / trello_timer.user.js
Created September 30, 2014 06:57
Trello를 이용한 Standing Meeting을 위한 Timer
// ==UserScript==
// @name Trello Timer
// @namespace http://blmarket.net/users
// @description Display open time for each cards
// @include https://trello.com/board/*
// @include https://trello.com/b/*
// @version 1
// @grant none
// ==/UserScript==
@goonoo
goonoo / thisplus.coffee
Last active August 29, 2015 14:06
bind this on coffeescript class
async_call = (callback) ->
setTimeout callback, 1
class ThisPlus
# 생성자
constructor: ->
# javascript의 this.do_something과 동일
@do_something()
callback = => # => 를 통해 내부 함수에 this를 binding
@do_something()
@goonoo
goonoo / number_format.coffee
Created September 3, 2014 08:34
super simple number format includes decimal point
number_format = (num) -> return String(num).replace(/(\d)(?=(\d{3})+\b)/g,'$1,')
@goonoo
goonoo / md5.js
Created August 18, 2014 06:00
Simple node.js md5 example
require('crypto').createHash('md5').update(STRING_TO_BE_HASHED).digest("hex")
@goonoo
goonoo / reset.styl
Last active August 29, 2015 14:04
super simple reset stylesheet in stylus format
body
margin 0
padding 0
background #fff
color #000
font 12px/1.2 sans-serif
form, fieldset, h1, h2, h3, ul, ol, li, p, button, input, textarea, dl, dt, dd
margin 0
padding 0
var async = {
map: function (arr, iterator, callback) {
throw "IMPLEMENT ME PLZ"
},
mapSeries: function (arr, iterator, callback) {
throw "IMPLEMENT ME PLZ"
}
};
var test_arr = [1,2,3,4,5,6,7,8,9,0];
@goonoo
goonoo / clear.css
Created August 1, 2013 04:25
CSS code to clear float
/* old IE(~7) clearing float */
.clear{*zoom:1}
/* modern browser include IE(8~) clearing float */
.clear:after{content:" ";display:block;clear:both}
@goonoo
goonoo / blind.css
Created May 6, 2013 06:56
VoiceOver 등 모든 스크린리더에서 읽어주는 방식의 요소 숨기기 (참고: http://snook.ca/archives/html_and_css/hiding-content-for-accessibility)
.blind {
position: absolute !important;
height: 1px; width: 1px;
overflow: hidden;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
}