Skip to content

Instantly share code, notes, and snippets.

View fundon's full-sized avatar
🎯
Focusing

Fangdun Tsai fundon

🎯
Focusing
View GitHub Profile
@fundon
fundon / ie-css-hacks.css
Created April 15, 2012 09:06 — forked from necolas/ie-css-hacks.css
IE CSS hacks
/*
* Property prefix hacks
*/
/* IE6 only - any combination of these characters */
_ - £ ¬ ¦
/* IE6/7 only - any combination of these characters */
@fundon
fundon / gist:2392456
Created April 15, 2012 12:17 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
SSHFS mount
1. http://code.google.com/p/macfuse/ (instalar MacFuse)
2. http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS (descompactar e copiar para /usr/local/bin/sshfs; dar permissao de execucao)
3. sshfs root@search_vm:/ /Users/lfais/work/search_vm/ -o allow_other,auto_cache,reconnect,volname=SEARCH_VM,defer_permissions
@fundon
fundon / mosh.wiki
Created April 16, 2012 07:44 — forked from goldeneggg/mosh.wiki
CentOS6.2にmoshを導入してMacから接続する

Mosh


% sudo yum -y install boost

% wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz % tar -zxvf protobuf-2.4.1.tar.gz % cd protobuf-2.4.1 % ./configure LDFLAGS=-Wl,-rpath,/usr/local/lib --prefix=/usr/local % make % sudo make install

@fundon
fundon / iir-retina.css
Created April 16, 2012 07:47 — forked from aarongustafson/iir-retina.css
Code examples for iIR Redux
@media only screen and (-moz-min-device-pixel-ratio: 2),
only screen and (-ms-min-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2),
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-device-pixel-ratio: 2)
{
#social-links img {
background: top left no-repeat;
background-size: 25px 25px;
display: inline-block;
@fundon
fundon / python-vs-go.mdown
Created April 16, 2012 07:47 — forked from sma/python-vs-go.mdown
Ich versuche Go zu lernen, indem ich das Grundgerüst für einen Python-Interpreter schreibe

Python vs. Go

Bekanntlich kann CPython Code nicht parallel in Betriebssystem-Threads ausführen. Es gibt den Global Interpreter Lock (GIL), der verhindert, dass dies passiert. Auf einem Computer mit mehr als einer CPU (dem Standard heutzutage), kämpfen alle paar Millisekunden die CPUs um den GIL, was dazu führt, dass die Laufzeit von CPython in diesem Fall deutlich schlechter als das theoretische Maximum ist.

Dieses Python-Programm braucht auf meinem Rechner etwa 9,5s:

def count_down(n):
    while n > 0:

n -= 1

@fundon
fundon / nextTick.js
Created April 17, 2012 19:07 — forked from mmalecki/nextTick.js
process.nextTick vs setTimeout(fn, 0)
for (var i = 0; i < 1024 * 1024; i++) {
process.nextTick(function () { Math.sqrt(i) } )
}
@fundon
fundon / LICENSE.txt
Created May 12, 2012 03:23
base64 decoder
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright* (C) 2011 Alex Kloss <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@fundon
fundon / textColor.js
Created May 17, 2012 06:10 — forked from swvitaliy/textColor.js
textColor
;(function(ns)
{
var color = {};
color.reHexTest = /^\s*#[\da-fA-F]{1,6}\s*$/;
color.reRgbTest = /^\s*rgb\s*\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)\s*$/i;
color.reRgbExec = /^\s*rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)\s*$/i;
color.reHexExec = /^\s*#([\da-fA-F]{1,2})([\da-fA-F]{1,2})?([\da-fA-F]{1,2})?\s*$/;