MD5: 59bab8f71f8c096cd3f72cd73851515d
Rename it to: Sublime Text
Make it executable with: chmod u+x Sublime\ Text
| # "Understanding Python's closures". | |
| # | |
| # Tested in Python 3.1.2 | |
| # | |
| # General points: | |
| # | |
| # 1. Closured lexical environments are stored | |
| # in the property __closure__ of a function | |
| # | |
| # 2. If a function does not use free variables |
| $ brew install libmagic | |
| $ brew link libmagic (if the link is already created is going to fail, don't worry about that) | |
| $ env ARCHFLAGS="-arch x86_64" gem install ruby-filemagic -- --with-magic-include=/usr/local/include --with-magic-lib=/usr/local/lib/ |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| /** | |
| * | |
| * Here's a thing that will look through all the text nodes of a document, and | |
| * upon encountering an emoji codepoint, will replace it with an image. | |
| * For now, those images are pulled from GitHub, which isn't very nice, so I | |
| * need to find a more suitable host. | |
| * | |
| * Much of this code was gleaned from staring at the minified GitHub JS. | |
| * | |
| * Copyright (c) 2013 Mark Wunsch. Licensed under the MIT License. |
| ; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32 | |
| global start | |
| section .text | |
| start: | |
| push dword msg.len | |
| push dword msg | |
| push dword 1 | |
| mov eax, 4 |
| /* ========================================================================= | |
| * First Come First Serve Scheduling | |
| * | |
| * DESCRIPTION | |
| * =========== | |
| * This is a simple C program to simulate the first come first serve | |
| * scheduling. The purpose of this program is to calculate the waiting time, | |
| * average waiting time and turn around time for a user input process queue. | |
| * | |
| * ========================================================================= |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| # Set variables in .bashrc file | |
| # don't forget to change your path correctly! | |
| export GOPATH=$HOME/golang | |
| export GOROOT=/usr/local/opt/go/libexec | |
| export PATH=$PATH:$GOPATH/bin | |
| export PATH=$PATH:$GOROOT/bin |