start new:
tmux
start new with session name:
tmux new -s myname
class UploadImage(): | |
""" | |
Upload images to imgur | |
returns either .error or .imageURL | |
TO DO: | |
POSSIBLE TO DO: | |
- add stats and image info functions | |
- allow for full JSON responses instead of having to manually parse XML |
<!-- Paste it in your address bar --> | |
data:text/html,<pre onkeyup="(function(d,t){d[t]('iframe')[0].contentDocument.body.innerHTML = d[t]('pre')[0].textContent;})(document,'getElementsByTagName')" style="width:100%;height:48%;white-space:pre-wrap;overflow:auto;" contenteditable></pre><iframe style="width:100%;height:48%"> |
#!/usr/bin/env ruby | |
## disconnect | |
# ./disconnect.rb -u yourusername [-o /your/path] [-p yourhttpproxyserver] | |
# | |
# This is a command-line utility for the bulk-downloading of run data from | |
# the connect.garmin.com web application, which has lackluster export | |
# capabilities. | |
# |
Compression: | |
xz: | |
real 18m43.520s | |
user 18m37.840s | |
sys 0m4.020s | |
gzip: | |
real 1m52.749s | |
user 1m42.180s | |
sys 0m3.260s |
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 |
We love solving puzzles at Priceonomics. We also like meeting people who like to solve puzzles. Here are two interesting puzzles we've faced at some point in the past months that we'd like to share with you.
If you have any questions, contact [email protected].
#!/usr/bin/env python | |
# Google Code Challenge - Credit Problem | |
# http://code.google.com/codejam/contest/351101/dashboard#s=p0 | |
import itertools | |
import bisect | |
from time import time | |
def last(array, num): |
/* palindrome.cpp | |
* C++ implementation of palindrome.py | |
* (https://gist.github.com/4081368) | |
* | |
* - Matthew Martz 2012 | |
*/ | |
#include <iostream> | |
#include <string> | |
#include <sstream> |
class ReloaderEventHandler(FileSystemEventHandler): | |
""" | |
Listen for changes to modules within the Django project | |
On change, reload the module in the Python Shell | |
Custom logic required to reload django models.py modules | |
Due to the singleton AppCache, which caches model references. | |
For those models files, we must clear and repopulate the AppCache | |
""" | |
def __init__(self, *args, **kwargs): |