Skip to content

Instantly share code, notes, and snippets.

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@kristianhellquist
kristianhellquist / custom.el
Created July 10, 2012 09:50
Emacs, copy current file and line number to clipboard
(defun copy-current-line-position-to-clipboard ()
"Copy current line in file to clipboard as '</path/to/file>:<line-number>'"
(interactive)
(let ((path-with-line-number
(concat (buffer-file-name) ":" (number-to-string (line-number-at-pos)))))
(x-select-text path-with-line-number)
(message (concat path-with-line-number " copied to clipboard"))))
(define-key global-map (kbd "M-l") 'copy-current-line-position-to-clipboard)
@sky-y
sky-y / my-open-emacs-at-point.el
Created August 5, 2012 08:58
Emacs: Open the file which filename is pointed in an other window or dired
;; Open the file name being pointed in an other window or dired
;; reference: http://kouzuka.blogspot.com/2011/02/emacsurlfinder.html
(defun my-directory-or-file-p (path)
"return t if path is a directory,
return nil if path is a file"
(car (file-attributes path)))
(defun my-open-emacs-at-point ()
"open the file with opening emacs"
(interactive)
@burke
burke / remotepaste.md
Last active September 26, 2023 11:04
This sets up keybindings in tmux that allow you to copy/paste to/from your OS X clipboard from tmux running inside an SSH connection to a remote host. Partially borrowed from http://seancoates.com/blogs/remote-pbcopy

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
@mikermcneil
mikermcneil / waterline.min.js.gz.sh
Created February 3, 2014 22:12
browserify, minify, and gzip Waterline
# browserify, minify, and gzip Waterline:
$ browserify lib/waterline.js -s Waterline | uglifyjs | gzip -c -f > browser/waterline.min.js.gz
@xem
xem / codegolf.md
Last active March 22, 2024 15:41
JS code golfing

codegolf JS

Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...

(For more info and other projects, visit http://xem.github.io)

(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)

@samgiles
samgiles / flatMap.js
Created June 20, 2014 11:32
Javascript flatMap implementation
// [B](f: (A) ⇒ [B]): [B] ; Although the types in the arrays aren't strict (:
Array.prototype.flatMap = function(lambda) {
return Array.prototype.concat.apply([], this.map(lambda));
};
/*global React, flyd, R*/
(function () {
'use strict';
var Player = function (control) {
return function (players) {
var player = {};
var possibleNewPosition = flyd.stream([control.move], function () {
return (player.position() || 0) + control.move();
});
var canMove = flyd.stream([possibleNewPosition], function () {
  • ## To watch
  • Ergo Proxy (2006-) TV
  • fargo 2 - [ ] Burnt (2015)
  • Bone Tomahawk (2015)
  • Black Sails (2014)
  • Macbeth (2015)
  • A Few Good Men (1992)
  • ## Postapocalyptic
  • Mad Max (1979) i reszta części
  • Water world (1995)