I hereby claim:
- I am tomhennigan on github.
- I am tomhennigan (https://keybase.io/tomhennigan) on keybase.
- I have a public key ASBYlo52VYIkmCXuhjwFIkiDCp8HcTEgwkXCgEF4nMMLugo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| def mkmatrix(size): | |
| matrix = [] | |
| for _ in xrange(size): | |
| matrix.append([False] * size) | |
| return matrix | |
| def addedge(matrix, nodea, nodeb): | |
| matrix[nodea][nodeb] = True | |
| matrix[nodeb][nodea] = True |
| echo " ╱┃┃╲ " | |
| echo "$(tput setaf 6) ╱┃┃╲$(tput sgr0)╲┃┃╱$(tput setaf 6)╱┃┃╲$(tput sgr0) $(hostname)" | |
| echo "$(tput setaf 6)┃╲╲┃┃╱╱┃┃╲╲┃┃╱╱┃$(tput sgr0) " | |
| echo "$(tput setaf 6)┃╱╱┃$(tput sgr0)┃╲$(tput setaf 6)╲┃┃╱$(tput sgr0)╱┃$(tput setaf 6)┃╲╲┃$(tput sgr0) Mesos: http://1.2.3.4:1234/" | |
| echo "$(tput setaf 6)┃╲╲┃$(tput sgr0)┃╱╱┃┃╲╲┃$(tput setaf 6)┃╱╱┃$(tput sgr0) Marathon: http://1.2.3.4:1234/" | |
| echo "$(tput setaf 6)┃╱╱┃$(tput sgr0)┃╲╲┃┃╱╱┃$(tput setaf 6)┃╲╲┃$(tput sgr0) Chronos: http://1.2.3.4:1234/" | |
| echo "$(tput setaf 6) ╲┃$(tput sgr0)┃╱╱┃┃╲╲┃$(tput setaf 6)┃╱$(tput sgr0) " | |
| echo " ╲┃┃╱ " |
| from delegates import DelegateProviderMixin, notify_delegates | |
| class Something(DelegateProviderMixin): | |
| @notify_delegates | |
| def do_something(self): | |
| print 'do_something' | |
| def do_something_else(self): | |
| print 'do_something_else' |
| from dateutil.relativedelta import relativedelta | |
| import unittest | |
| class Test_relativedelta(unittest.TestCase): | |
| def test___lt__(self): | |
| # For all fields test that a relative delta with only a single field | |
| # set behaves as expected. | |
| self.assertLess(relativedelta(years=1990), relativedelta(years=2012)) | |
| self.assertLess(relativedelta(months=1), relativedelta(months=12)) |
| def notify_delegates(method): | |
| """Decorator to call delegate methods. When decorating a method it will | |
| call `onBeforeMethodName` and `onAfterMethodName` (uppercasing the first | |
| letter of the method name). | |
| Delegate methods are called before and after the actual method is called. | |
| On the after method the return value from the method is passed in as the | |
| `ret_value` keyword arg.""" | |
| # Figure out delegate method names. |
4 rounds mean (from 100 iters): 0.00127s per call (~784.45 hashes/s)
5 rounds mean (from 100 iters): 0.00236s per call (~423.79 hashes/s)
6 rounds mean (from 100 iters): 0.00454s per call (~220.03 hashes/s)
7 rounds mean (from 100 iters): 0.01016s per call (~98.45 hashes/s)
8 rounds mean (from 100 iters): 0.01793s per call (~55.78 hashes/s)
9 rounds mean (from 100 iters): 0.03526s per call (~28.36 hashes/s)
10 rounds mean (from 71 iters): 0.07035s per call (~14.22 hashes/s)
| #!/bin/sh | |
| frames=( "(╮°-°)╮ ┳━┳" "(╯°o°)╮ ┳━┳" "(╯°o°)╯ ︵ ╡" "(╯°o°)╯ ︵┻━┻" "(╮°□°)╮ ┻━┻" ); | |
| for frame in "${frames[@]}"; do | |
| printf "%s\033[0K\r" "${frame}"; | |
| sleep 0.5; | |
| done |
| #!/usr/bin/env php | |
| <?php | |
| define('DEBUG', false); | |
| class Logger | |
| { | |
| private $fp; | |
| public function __construct($fp) { | |
| $this->fp = $fp; |
| tell application "Google Chrome" | |
| set win to make new window with properties {mode:"incognito"} | |
| activate | |
| tell application "System Events" to keystroke "f" using {command down, shift down} | |
| tell win | |
| set URL of active tab to "http://cl.ly/0t1J3d0c1o3i" | |
| end tell | |
| end tell |