Skip to content

Instantly share code, notes, and snippets.

What

Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time
@ageek
ageek / gist:7654585
Created November 26, 2013 07:25 — forked from dmaniry/gist:5170087
import numpy as np
from scipy import linalg
from sklearn.utils import array2d, as_float_array
from sklearn.base import TransformerMixin, BaseEstimator
class ZCA(BaseEstimator, TransformerMixin):
def __init__(self, regularization=10**-5, copy=False):
self.regularization = regularization
def sigmoid(X):
'''Compute the sigmoid function '''
#d = zeros(shape=(X.shape))
den = 1.0 + e ** (-1.0 * X)
d = 1.0 / den
return d
library(dplyr)
#train <- read.csv("train.csv")
test <- read.csv("test_v2.csv")
last_items <- test %.%
group_by(customer_ID) %.%
filter(shopping_pt==max(shopping_pt)) %.%
mutate(plan=paste(A,B,C,D,E,F,G,sep='')) %.%
select(customer_ID,plan)
## Correlation matrix with p-values. See http://goo.gl/nahmV for documentation of this function
cor.prob <- function (X, dfr = nrow(X) - 2) {
R <- cor(X, use="pairwise.complete.obs")
above <- row(R) < col(R)
r2 <- R[above]^2
Fstat <- r2 * dfr/(1 - r2)
R[above] <- 1 - pf(Fstat, 1, dfr)
R[row(R) == col(R)] <- NA
R
}
@ageek
ageek / ribbon
Last active August 29, 2015 14:22 — forked from zross/ribbon
# quick example of creating a plot like that at the link below
# http://www.visualisingdata.com/index.php/2015/01/make-grey-best-friend/
x<-1:10
y<-x^2
z<-x
radius<-x/5
dat<-data.frame(x=x, y=y, z=z, radius=radius)
ggplot(dat, aes(x,y))+
geom_ribbon(aes(ymin=y-radius, ymax=y+radius), alpha=0.5, fill="grey", color="grey", size=1)+
@ageek
ageek / dict_to_df
Last active August 29, 2015 14:23 — forked from erinshellman/dict_to_df.R
py_dict = readLines('python_dictionary.txt')
# e.g.
#{"cat_name": "Ella", "dwell_status": "tree_dweller", "coat_color": "gray, white, orange", "is_from_hell": "Y"}
#{"cat_name": "Billie", "dwell_status": "bush_dweller", "coat_color": "gray, white", "is_from_hell": "N"}
dict_to_df = function(dict) {
require(plyr)
df = data.frame()
df_temp = list()
@ageek
ageek / .gitconfig
Created December 17, 2015 12:08 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@ageek
ageek / README.md
Created May 10, 2017 16:40 — forked from thegaragelab/README.md
Driving a Nokia 5110 LCD with the ATtiny85 Template Library

This gist provides sample code for using Nokia 5110 displays using the ATtiny85 template library. For a full description of code behind this please see this post on The Garage Lab website.

To use this sample code first clone the ATtiny85 template repository and then replace 'main.c' with the source provided here.

@ageek
ageek / Attiny_gps_beacon.ino
Created March 1, 2018 06:50 — forked from dwhacks/Attiny_gps_beacon.ino
Attiny softserial and gps
/*
Original code come from Adafruit GPS logger shield kit - v1.1
http://www.adafruit.com/products/98
http://www.ladyada.net/make/gpsshield/download.html
All of this example Arduino code is Public Domain. Enjoy!
http://en.wikipedia.org/wiki/GNU_General_Public_License
Modified by DWHacks for use with U-blox PCI-5S.
Info about U-blox PCI-5S here: http://emerythacks.blogspot.ca/2013/01/u-blox-pci-5s-cheap-gps-module-for-your.html