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
[alias] | |
smartlog = log --graph --pretty=format:'%C(dim white)(%h)%Creset %C(bold white)%s%Creset %C(bold magenta)%d%Creset%n %C(bold cyan)%an%Creset %C(blue)(%ae)%Creset %C(dim blue)%ci %Creset%n' | |
sl = !git smartlog | |
// Set globally | |
$ git config --global alias.smartlog "log --graph --pretty=format:'%C(dim white)(%h)%Creset %C(bold white)%s%Creset %C(bold magenta)%d%Creset%n %C(bold cyan)%an%Creset %C(blue)(%ae)%Creset %C(dim blue)%ci %Creset%n'" | |
$ git config --global alias.sl '!git smartlog' |
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
use std::fmt; | |
use serde::de; | |
use chrono::{DateTime, Utc, FixedOffset}; | |
use chrono::offset::{LocalResult, TimeZone}; | |
pub fn deserialize<'de, D>(d: D) -> Result<DateTime<Utc>, D::Error> | |
where D: de::Deserializer<'de> | |
{ | |
Ok(try!(d.deserialize_i64(SecondsTimestampVisitor).map(|dt| dt.with_timezone(&Utc)))) |
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
import json | |
import googlemaps | |
import os | |
import sqlite3 | |
from datetime import datetime | |
def extractDurationInTrafficFromResponse(response): | |
return response[0]['legs'][0]['duration_in_traffic'] |
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
{ | |
"api_key":"Google Maps API Key for Directions", | |
"home": [ | |
37.743658, | |
-119.599653 | |
], | |
"work": [ | |
37.481642, | |
-122.155606 | |
] |
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
import json | |
import googlemaps | |
from datetime import datetime | |
def extractDurationInTrafficFromResponse(response): | |
return response[0]['legs'][0]['duration_in_traffic'] | |
def timesBetweenPoints(client, origin, destination): | |
best_guess_response = client.directions(origin, | |
destination, |
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
{ | |
"version": "2", | |
"org_fee": "0.00006", | |
"org_address": "15PAcEwJQdH9JVti9w4q8vtMXZhW36JCm9", | |
"nodes": [ | |
{ | |
"pubkey": "03429116ecdd384757219a37e62a5154236eb334faafae8f910fbb9e015f695e0a", | |
"address": "1BzHARiQTgxYWq8YFDVnnAFLxgpYvirrdf", | |
"fee": "0.00003" | |
} |
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
import uuid # from http://zesty.ca/python/uuid.html | |
import sys | |
import base64 | |
def fetch_code(custom_string="CODE_'): | |
""" | |
takes an optional argument, a string to be put at the beginning of a code, | |
so the code will look like that: |