Skip to content

Instantly share code, notes, and snippets.

View outsideris's full-sized avatar

Outsider outsideris

View GitHub Profile
@outsideris
outsideris / etckeeper.sh
Last active October 5, 2015 10:18
using etckeeper
$ sudo apt-get install git-core etckeeper
#configure git
# edit /etc/etckeeper/etckeeper.conf
$ sudo etckeeper init
$ sudo etckeeper commit “Initial Commit”
$ cd /etc
$ sudo git status
@outsideris
outsideris / LasMultiMap.scala
Created May 13, 2012 06:58
implement multimap in scala
package pis.chap22.multimap
import scala.collection.immutable.HashMap
class LasMultiMap[A, B] {
var mmap = new HashMap[A, List[B]]
def put(key:A, value:B) = {
if (mmap.contains(key)) {
mmap = mmap + ( (key, mmap.get(key).toList(0) ::: List(value) ))
} else {
mmap = mmap + ( (key, List(value)) )
@outsideris
outsideris / gist:2623342
Created May 6, 2012 17:12
repeatly exec
watch -n 1 "COMMAND"
@outsideris
outsideris / encryption.sh
Last active October 4, 2015 05:18
openssl encryption
$ openssl des3 -salt -in plain.txt -out encrypted.txt
@outsideris
outsideris / sed_usage
Created March 23, 2012 02:58
sed usage
sed -n '/패턴/p' # 패턴의 라인만 출력
sed 's/패턴/치환문자/g' # 문자열 바꾸기
#정규식
\n # new line
\+ # 1개 이상
\{n\} # n개이상
@outsideris
outsideris / Cakefile
Created November 2, 2011 18:48
cakefile for epub
task 'epub', ->
exec 'pandoc -S --epub-stylesheet style.css -o output/nodebook.epub ' +
'chapters/prologue.md ' +
'chapters/overview.md ' +
'chapters/history.md ' +
'chapters/installation.md ' +
'chapters/gettingstarted.md ' +
'chapters/tcpchat.md ' +
'chapters/twitter.md ' +
'chapters/npm.md ' +
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
@outsideris
outsideris / dom_loaded.js
Created October 1, 2011 05:21
Dom loaded
// jquery
$(document).ready(function(){
});
// prototype.js
document.observe("dom:loaded", function() {
});
// vanilla javascript (it's not dom loaded)
window.onload = function() {
@outsideris
outsideris / index.jade
Created July 7, 2011 01:28
socket.io examample 2
script(src='/socket.io/socket.io.js')
script
window.onload = function() {
var socket = io.connect('/test');
socket.on('connect', function() {
console.log('connected');
socket.emit('mock', 'test message');
});
socket.on('mock', function(msg) {
@outsideris
outsideris / index.jade
Created July 7, 2011 01:25
socket.io examample 1
script(src='/socket.io/socket.io.js')
script
window.onload = function() {
var socket = io.connect('/test');
socket.on('connect', function() {
console.log('connected');
socket.send('test message');
});
socket.on('message', function(msg) {