This file contains 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
$ 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 |
This file contains 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
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)) ) |
This file contains 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 -n 1 "COMMAND" |
This file contains 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
$ openssl des3 -salt -in plain.txt -out encrypted.txt |
This file contains 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
sed -n '/패턴/p' # 패턴의 라인만 출력 | |
sed 's/패턴/치환문자/g' # 문자열 바꾸기 | |
#정규식 | |
\n # new line | |
\+ # 1개 이상 | |
\{n\} # n개이상 |
This file contains 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
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 ' + |
This file contains 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
# 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: |
This file contains 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
// jquery | |
$(document).ready(function(){ | |
}); | |
// prototype.js | |
document.observe("dom:loaded", function() { | |
}); | |
// vanilla javascript (it's not dom loaded) | |
window.onload = function() { |
This file contains 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
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) { |
This file contains 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
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) { |