Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
| # found this from Armin R. on Twitter, what a beautiful gem ;) | |
| import ctypes | |
| from types import DictProxyType, MethodType | |
| # figure out side of _Py_ssize_t | |
| if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'): | |
| _Py_ssize_t = ctypes.c_int64 | |
| else: | |
| _Py_ssize_t = ctypes.c_int |
| @mixin box-shadow($top, $left, $blur, $color, $inset: false) { | |
| @if $inset { | |
| -webkit-box-shadow:inset $top $left $blur $color; | |
| -moz-box-shadow:inset $top $left $blur $color; | |
| box-shadow:inset $top $left $blur $color; | |
| } @else { | |
| -webkit-box-shadow: $top $left $blur $color; | |
| -moz-box-shadow: $top $left $blur $color; | |
| box-shadow: $top $left $blur $color; | |
| } |
| #!/bin/sh | |
| # Dropbox setup on a headless Ubuntu Server | |
| # Script written by Jesse B. Hannah (http://jbhannah.net) <[email protected]> | |
| # Based on http://wiki.dropbox.com/TipsAndTricks/UbuntuServerInstall | |
| ### | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| /* http://meyerweb.com/eric/tools/css/reset/ | |
| v2.0 | 20110126 | |
| License: none (public domain) | |
| */ | |
| html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { | |
| margin: 0; | |
| padding: 0; | |
| border: 0; | |
| font-size: 100%; |
| # Python/Twisted/Redis backed DNS server - resolves from NAME to IP addrs | |
| # fallback to google or any other DNS server to resolv domains not present on Redis | |
| # to set a new domain on redis, just issue a SET domain.tld ip_addr | |
| # run with twistd -ny txredns.tac | |
| # gleicon 2011 | |
| from twisted.names import dns, server, client, cache | |
| from twisted.application import service, internet | |
| from twisted.internet import defer | |
| from twisted.python import log |
| # http://notmysock.org/blog/hacks/a-twisted-dns-story.html | |
| # http://blog.inneoin.org/2009/11/i-used-twisted-to-create-dns-server.html | |
| # twistd -y dns.py | |
| import socket | |
| from twisted.internet.protocol import Factory, Protocol | |
| from twisted.internet import reactor | |
| from twisted.names import dns | |
| from twisted.names import client, server |
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
| #!/usr/bin/python | |
| # coding=utf-8 | |
| # Python version of Zach Holman's "spark" | |
| # https://github.com/holman/spark | |
| # by Stefan van der Walt <[email protected]> | |
| """ | |
| USAGE: |
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
| Copyright the authors of Honcho and/or Ben Lopatin | |
| Licensed for reuse, modification, and distribution under the terms of the MIT license |