Updated: Just use qutebrowser (and disable javascript). The web is done for.
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
I turned this gist into a "real" repository. It is here: http://github.com/pete/cats . | |
Here, placed side-by-side for comparison, are GNU's implementation of | |
cat, Plan 9's implementation, Busybox's implementation, and NetBSD's | |
implementation, Seventh Edition Unix (1979), and 4.3BSD. | |
For good measure (and because I suppose I am now committed to collecting | |
cats) also included are Second Edition Unix (in assembly) and Inferno's | |
implementation (in Limbo) for good measure. |
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
; A minimal Mach-o x64 executable for OS X (also see below Mountain Lion version) | |
; | |
; $ nasm -f bin -o tiny_hello tiny_hello.s | |
; $ chmod +x tiny_hello | |
; $ ./tiny_hello | |
; Hello World! | |
; $ | |
; c.f. | |
; http://osxbook.com/blog/2009/03/15/crafting-a-tiny-mach-o-executable/ ( the original tiny mach-o executable ) |
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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
var _log = console.log; | |
window.console.log = function(log){ | |
_log.call(console, log.reverse ? log.reverse() : typeof log === 'string' ? log.split('').reverse().join('') : typeof log === 'number' ? log.toString().split('').reverse().join('') : typeof log === 'boolean' ? !log : log); | |
}; |
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
// by dw @ bees & bombs >:) | |
int[][] result; | |
float t; | |
void setup() { | |
setup_(); | |
result = new int[width*height][3]; | |
} |
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 slapd ldap-utils | |
sudo dpkg-reconfigure slapd | |
sudo apt-get install gosa gosa-schema | |
sudo vi /etc/ldap/convert.conf << EOT | |
include /etc/ldap/schema/core.schema | |
include /etc/ldap/schema/cosine.schema | |
include /etc/ldap/schema/nis.schema | |
include /etc/ldap/schema/inetorgperson.schema |
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
# | |
# I inherited a large code base, where hundreds of code paths end up | |
# calling "common_function_called_in_gazillion_places". | |
# | |
# And the need arose for this function to access the HTTP request's | |
# headers... | |
# | |
# What to do? Refactor all the places leading up to here? In a dynamically | |
# typed language, with no compiler to tell us the places to refactor? | |
# |
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
""" | |
pybble.py | |
Yup, you can run Python on your Pebble too! Go thank the good folks who | |
made Transcrypt, a dead-simple way to take your Python code and translate | |
it to *very* lean Javascript. In our case, instead of browser, we run it | |
on Pebble using their equally dead-simple Online IDE and Pebble.js library. | |
Here's a working example, it runs on a real Pebble Classic. |
OlderNewer