Skip to content

Instantly share code, notes, and snippets.

View roablep's full-sized avatar

Peter Elbaor roablep

View GitHub Profile
@lifehome
lifehome / webhook.gs
Created August 24, 2016 14:48
Google Forms + Webhook : JSON example
function onFormSubmit(e) {
var data = {
"form": {
"id": e.source.getId(),
"title": e.source.getTitle() ? e.source.getTitle() : "Untitled Form",
"is_private": e.source.requiresLogin(),
"is_published": e.source.isAcceptingResponses(),
},
"response": {
"id": e.response.getId(),
@rosswd
rosswd / pipenv.sh
Last active March 5, 2018 01:54
Using pip, virtualenv and/or virtualenvwrapper to manage packages and environments in python.
# know what version of python you have
python # os (2.7.10)
python2 # homebrew python 2 (2.7.14)
python3 # homebrew python 3 (3.6.2)
# install pipenv
pip3 install pipenv
export PATH=$PATH:$HOME/Library/Python/3.6/bin >> ~/.bash_exports
# use
@bf4
bf4 / services.md
Last active August 2, 2017 13:26
Analytics, Metrics and Error monitoring services (and roll your own via logging, etc)
@josef-pkt
josef-pkt / empirical_likelihood.py
Created March 20, 2012 19:29 — forked from jseabold/empirical_likelihood.py
Empirical Likelihood with Moment Constraints
'''
Author: Skipper
https://gist.github.com/2109628
Josef: adjustments to example
'''
from statsmodels.base.model import LikelihoodModel
@jseabold
jseabold / empirical_likelihood.py
Created March 19, 2012 12:11
Empirical Likelihood with Moment Constraints
from statsmodels.model import LikelihoodModel
import numpy as np
from numpy import asarray
from scipy import optimize
def log_star(z, eps):
"""
Owens' log* function. Provides curvature at eps.
"""
log_idx = z > eps
@cthiel
cthiel / Gemfile
Created September 23, 2011 09:40
Parser for Amazon EC2 Public IP Range Announcements
source :rubygems
gem 'nokogiri'
gem 'netaddr'
# Target is to generate a graph file in gexf format (http://gexf.net/format) for Gephi
#-----------------------------------------------------
# STEP 1
# Generate nodes and edgelist from each email log file
#-----------------------------------------------------
setwd("C:/R")
# use sqldf for operations suited for db http://code.google.com/p/sqldf/