Skip to content

Instantly share code, notes, and snippets.

def to_dataframe(columns=None, iter=None):
"""
Decorator to return a pandas DataFrame from an iterator.
"""
def decorator(f):
@wraps(f)
def wrapper(*args, **kwds):
arr = list(f(*args, **kwds))
iter_columns = []
addprocs(3)
type AtomicTask
category::Symbol
end
const jobs = RemoteChannel(()->Channel{AtomicTask}(Inf))
const results = RemoteChannel(()->Channel{Float64}(Inf))
@everywhere function execute_jobs(jobs, results)
@cynddl
cynddl / tether_usb.sh
Created February 14, 2017 11:05
Android USB tethering with HoRNDIS
#!/bin/sh
adb root
adb shell service call connectivity 30 i32 1
sudo kextunload /Library/Extensions/HoRNDIS.kext
sudo kextload /Library/Extensions/HoRNDIS.kext
#!/usr/bin/env python
from xmlrpc.client import ServerProxy
import click
@click.command()
@click.option('--alias', '-a', help='alias to add to the default mail account')
@click.option('--login', default='YOUR_LOGIN')
@click.option('--domain', default='YOUR_DOMAIN')
def main(alias, login, domain):
@cynddl
cynddl / gist:9fbff472034d05f11a4e
Created February 26, 2016 12:46
libxmlsec1.dylib symbols list
000000000002a076 T _xmlSecAddChild
000000000002a24e T _xmlSecAddChildNode
000000000002ab36 T _xmlSecAddIDs
000000000002a385 T _xmlSecAddNextSibling
000000000002a505 T _xmlSecAddPrevSibling
0000000000031f8e S _xmlSecAttrAlgorithm
0000000000031f85 S _xmlSecAttrEncoding
0000000000031f98 S _xmlSecAttrFilter
0000000000031f70 S _xmlSecAttrId
0000000000031f7c S _xmlSecAttrMimeType
from __future__ import division
import bandicoot as bc
import datetime
import json
def load_google_gps(json_path, name='me'):
"""
Loads history from https://google.com/maps/timeline into
a bandicoot User object.
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript">
paceOptions = {
document: false,
}
</script>
<script type="text/javascript" src="bower_components/pace/pace.js" ></script>
@cynddl
cynddl / table-cit.xslt
Created April 10, 2013 08:41
XSLT – table cit
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY deg "&#176;" >
<!ENTITY laquo "&#171;" ><!-- guillemets ouvrants -->
<!ENTITY raquo "&#187;" ><!-- guillements fermants -->
<!ENTITY nbsp "&#160;" ><!-- espace insécable -->
<!ENTITY para "&#182;" ><!-- signe paragraphe (P double barre verticale inversé) -->
<!ENTITY iquest "&#191;" ><!-- point d'interrogation à l'envers -->
@cynddl
cynddl / table-ref.xslt
Last active December 16, 2015 01:09
XLST – table ref
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY deg "&#176;" >
<!ENTITY laquo "&#171;" ><!-- guillemets ouvrants -->
<!ENTITY raquo "&#187;" ><!-- guillements fermants -->
<!ENTITY nbsp "&#160;" ><!-- espace insécable -->
<!ENTITY para "&#182;" ><!-- signe paragraphe (P double barre verticale inversé) -->
<!ENTITY iquest "&#191;" ><!-- point d'interrogation à l'envers -->
@cynddl
cynddl / test_cas_client.go
Last active August 29, 2015 14:07
Testing a simple CAS authentication
package main
import (
"net/http"
"net/url"
"io/ioutil"
"log"
"strings"