Skip to content

Instantly share code, notes, and snippets.

@adamf
adamf / gist:1043012
Created June 23, 2011 17:10
Experiments in R
# generate the distribution data and melt appropriately
k = rbind(t(replicate(100, rnorm(100,10,2))), t(replicate(100, rchisq(100,5, 2))))
s = t(apply(k, 1, summary))
foo = melt(s)
bar = melt(k)
# a plot of the smoothed data
ggplot(bar, aes(y=value, x=X1)) + geom_smooth() + ylab("milliseconds") + xlab("time")
@taizo
taizo / mk_rpmbuild_dir.sh
Created April 23, 2012 01:04
Creating an RPM build environment
#!/bin/sh
rpmbuild_user=rpmbuild
yum install -y rpm-build
/sbin/useradd -c "RPM Package Maintainer" ${rpmbuild_user}
su - ${rpmbuild_user} -c "mkdir -p pkgs/{RPMS/{noarch,i{3,4,5,6}86,x86_64},SRPMS,SOURCES,SPECS,BUILD,BUILDROOT}"
@straversi
straversi / bookmarklet.js
Created July 28, 2015 18:50
remove sidebar on reddit
javascript:(function()%7Bdocument.getElementsByClassName(%27side%27)%5B0%5D.style.display%3D%27none%27%3B%7D)()%3B
@ustun
ustun / boot2docker notes for OS X.md
Last active March 2, 2018 03:37
boot2docker notes for OS X

This document contains some notes I have gathered while I was trying to setup a redis service using boot2docker running on OS X. This won't cover what Docker is, see Docker website for details.

Installing boot2docker

First, install Virtualbox and follow the steps at http://docs.docker.com/installation/mac/

Since Docker only runs on Linux, boot2docker runs a virtual machine in Virtualbox (or VMWare etc), however you can run the docker command on OS X

@shiffman
shiffman / recordinglist.md
Last active September 13, 2019 15:53
A list of ideas for #CodingRainbow Video topics: https://www.youtube.com/user/shiffman
@nickstenning
nickstenning / docker.sh
Created July 28, 2014 12:36
Docker cleanup aliases
alias dockercleancontainers="docker ps -a --no-trunc | grep 'Exit' | awk '{print $1}' | xargs docker rm"
alias dockercleanimages="docker images --no-trunc | grep none | awk '{print $3}' | xargs docker rmi"
alias dockerclean="dockercleancontainers && dockercleanimages"
@NorikDavtian
NorikDavtian / .bash_aliases
Created May 31, 2017 00:51
Docker cleanup bash aliases
# ~/.bash_aliases
# https://www.calazan.com/docker-cleanup-commands/
# Kill all running containers.
alias dockerkillall='docker kill $(docker ps -q)'
# Delete all stopped containers.
alias dockercleanc='printf "\n>>> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q)'
# Delete all untagged images.
@yashh
yashh / lync_bot.py
Created July 26, 2014 23:53
Python lync API bot
import base64, copy, sys
import requests
import json
from urlparse import urlparse
sip_domain = "company.com"
username = "firstname.lastname@company.com"
password = "somepassword"
def extractAuthURL(str):
@jonathan-taylor
jonathan-taylor / execute_and_save.py
Created June 8, 2012 08:09
A script to load an .ipynb file, execute all cells in order and output the resulting notebook. Depends on https://github.com/jonathan-taylor/nbconvert/tree/json2json
"""
simple example script for running notebooks and saving the resulting notebook.
Usage: `execute_and_save.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and the outputs are overwritten and
stored in new notebooks foo_executed.ipynb, etc.
"""
import os,sys,time
@jeromeetienne
jeromeetienne / webgl_geometry_cube2.html
Created July 26, 2011 13:15
Basic Example of a Cube with Three.js
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>three.js canvas - geometry - cube</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<style type="text/css">
body {
background-color: #f0f0f0;
margin: 0px;