Skip to content

Instantly share code, notes, and snippets.

View stevekm's full-sized avatar

Stephen Kelly stevekm

View GitHub Profile
@stevekm
stevekm / rubby.md
Last active November 3, 2016 17:09
OS X El Capitan installation of Ruby gems for Jekyll setup
@pingf
pingf / dash_button.py
Created July 6, 2017 15:28
dash_2button_switch
# -*- coding: utf-8 -*-
from time import sleep
import dash
from dash_core_components import Graph
from dash_html_components import H1, Div, Button
from comp import Button
from dash.dependencies import Input, Output, Event, State
app = dash.Dash()
@pathunstrom
pathunstrom / index.html
Created January 11, 2018 01:02
Dual Movement
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.box {
height: 100px;
width: 100px;
top: 100px;
@netj
netj / csv2tsv.py
Created August 16, 2010 14:38
CSV to TSV python one-liner
#!/usr/bin/env python
import sys,csv
for row in csv.reader(sys.stdin):
print "\t".join(row)
@yannabraham
yannabraham / beanplots.R
Created July 16, 2012 09:31
ggplot2 BeanPlots
## reproduce the figures from http://www.jstatsoft.org/v28/c01/paper using ggplot2
library(ggplot2)
## parameters
set.seed(2710)
## Figure 1
d <- rnorm(50)
@CuriousGnu
CuriousGnu / beezid_scraper.py
Created April 3, 2016 14:15
Beezid.com - Auction Scraper
import pycurl
import json
import time
from StringIO import StringIO
i = 0
bnums = []
while True :
print(str(i))
@stephenturner
stephenturner / volcanoplot.r
Last active May 13, 2021 20:11
code from blog post to make a volcano plot
# Download the data from github (click the "raw" button, save as a text file called "results.txt").
# https://gist.github.com/stephenturner/806e31fce55a8b7175af
res <- read.table("results.txt", header=TRUE)
head(res)
# Make a basic volcano plot
with(res, plot(log2FoldChange, -log10(pvalue), pch=20, main="Volcano plot", xlim=c(-2.5,2)))
# Add colored points: red if padj<0.05, orange of log2FC>1, green if both)
with(subset(res, padj<.05 ), points(log2FoldChange, -log10(pvalue), pch=20, col="red"))
@Glench
Glench / python-async-callback.py
Last active August 2, 2021 10:34
An example of how to vary a parameter for an async callback function in python. Hint: don't use lambda functions in loops!
"""
We want to run a function asychronously and run a
callback function with multiple parameters when it
returns!
In this example, we are pretending we're analyzing
the names and ages of some people. We want to print
out:
jack 0
@mawaldne
mawaldne / gist:6272854
Last active August 5, 2021 11:33
Read the first line of a file in groovy
def line
new File("test.txt").withReader { line = it.readLine() }
println line