#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
| 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 |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <link rel="stylesheet" href="style.css"> | |
| </head> | |
| <body> | |
| <svg id="defs"> | |
| <defs> | |
| <linearGradient id="gradBlue" x1="0%" y1="0%" x2="100%" y2="0%"> |
Since password managers are big and complicated and I currently am pretty bored since I am sitting in a car for a few hours, here is a simple algorithm to generate resource-specific, unique passwords using a master password and no password database.
As pointed out here: http://news.ycombinator.com/item?id=4374888 this method is broken.
| #!/bin/bash | |
| function addnext { | |
| NUM=$1 | |
| sleep 1 | |
| echo HI $NUM | |
| NUM=$(expr $NUM + 1) | |
| echo addnext $NUM >> $0 | |
| } |
| #!/usr/bin/env bash | |
| # | |
| # Wrapper around gmvault binary that sets default options. | |
| GMVAULT_DIR="$HOME/Dropbox/Applications/Utilities/gmvault-v1.7-beta/bin/" | |
| DB_DIR="$HOME/Dropbox/.gmvault-db" | |
| # Run in a sub-shell since we need to change directories: | |
| ( | |
| cd $GMVAULT_DIR |
| import numpy as np | |
| def euler_rot(XYZ,phi,theta,psi): | |
| '''Returns the points XYZ rotated by the given euler angles''' | |
| ERot = np.array([[np.cos(theta)*np.cos(psi), | |
| -np.cos(phi)*np.sin(psi) + np.sin(phi)*np.sin(theta)*np.cos(psi), | |
| np.sin(phi)*np.sin(psi) + np.cos(phi)*np.sin(theta)*np.cos(psi)], | |
| [np.cos(theta)*np.sin(psi), | |
| np.cos(phi)*np.cos(psi) + np.sin(phi)*np.sin(theta)*np.sin(psi), |
| <!DOCTYPE> | |
| <html> | |
| <head> | |
| <title>Dissecting Gmail's Email Attachments - Dropping Files</title> | |
| <style> | |
| .msg { | |
| display: none | |
| } | |
| .dragging .msg { |
This script processes VIIRS Nighttime Lights 2012 GeoTIFFs from the Earth Observation Group at NOAA National Geophysical Data Center to prepare them for rendering in TileMill and uploading to MapBox Hosting.
Read Lights of the Night on MapBox to learn more about NPP the functions of this script.
| import email | |
| def get_decoded_email_body(message_body): | |
| """ Decode email body. | |
| Detect character set if the header is not set. | |
| We try to get text/plain, but if there is not one then fallback to text/html. | |
| :param message_body: Raw 7-bit message body input e.g. from imaplib. Double encoded in quoted-printable and latin-1 |