This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# Based on https://github.com/ikasamah/withings-garmin/blob/master/withings.py | |
import urllib | |
from datetime import datetime | |
import urlparse | |
import oauth2 as oauth | |
try: | |
import json |
This file contains hidden or 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
#Quick cp from http://sekati.com/etc/install-nodejs-on-debian-squeeze | |
# | |
#Needed to install TileMill from MapBox | |
# | |
#Installs node.js which has npm bundled | |
# | |
#Build Dependencies | |
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev |
This file contains hidden or 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
public class Adler32 | |
{ | |
public uint checksum = 1; | |
/// <summary>Performs the hash algorithm on given data array.</summary> | |
/// <param name="bytesArray">Input data.</param> | |
/// <param name="byteStart">The position to begin reading from.</param> | |
/// <param name="bytesToRead">How many bytes in the bytesArray to read.</param> | |
public void ComputeHash(byte[] bytesArray, int byteStart, int bytesToRead) | |
{ |
This file contains hidden or 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
__author__ = 'cazamagni' | |
import math | |
def haversine_distance(origin, destination): | |
''' | |
http://en.wikipedia.org/wiki/Haversine_formula | |
Wayne Dyck's implementation | |
''' |
This file contains hidden or 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
'''Provides utility functions for encoding and decoding linestrings using the | |
Google encoded polyline algorithm. | |
''' | |
def encode_coords(coords): | |
'''Encodes a polyline using Google's polyline algorithm | |
See http://code.google.com/apis/maps/documentation/polylinealgorithm.html | |
for more information. | |
This file contains hidden or 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 logging | |
import datetime | |
from pymongo import MongoClient | |
__author__ = 'cazamagni' | |
''' | |
Configuration example: | |
logging.basicConfig(level=logging.INFO) |
This file contains hidden or 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
from lib import xlwt | |
__author__ = 'cazamagni' | |
class ExcelDumper(object): | |
def __init__(self): | |
self.workbook = xlwt.Workbook(encoding='utf-8') | |
self.sheet = self.workbook.add_sheet('Sheet1') |
This file contains hidden or 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
''' | |
Intended to be used like this: | |
''' | |
@After(my_after_func) # my_after_func gets called with the same arguments passed to 'sut_func' | |
@Before(my_before_func) # as above | |
@SendResultTo(my_related_func) # my_related_func gets invoked after 'sut_func': my_related_func(**sut_result) | |
def sut_func(*args, **kwargs): | |
return 'blah blah' |
This file contains hidden or 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
Show hidden characters
[ | |
{ | |
"class": "sidebar_container", | |
// $base01: #586e75 | |
"layer0.tint": [88,110,117], | |
"layer0.opacity": 1.0, | |
"layer0.draw_center": false, | |
"layer0.inner_margin": [0, 0, 1, 0], | |
"content_margin": [0, 0, 1, 0] |
This file contains hidden or 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
var App = angular.module('App', []); | |
App.controller('TodoCtrl', function($scope, $http) { | |
$http.get('todos.json') | |
.then(function(res){ | |
$scope.todos = res.data; | |
}); | |
}); |
OlderNewer