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")
@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;
@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}"
@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
@nhoffman
nhoffman / pyscript.py
Last active February 20, 2024 22:30
Python script template
#!/usr/bin/env python3
"""A simple python script template.
"""
import os
import sys
import argparse
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 5, 2024 13:30
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@jefftriplett
jefftriplett / tor.py
Last active May 22, 2023 09:10
Python Requests + Tor (Socks5)
"""
setup:
pip install requests
pip install requests[socks]
super helpful:
- http://packetforger.wordpress.com/2013/08/27/pythons-requests-module-with-socks-support-requesocks/
- http://docs.python-requests.org/en/master/user/advanced/#proxies
"""
@blackjid
blackjid / README.md
Last active June 11, 2023 15:15
How configure your raspberry pi with dashing to have a awesome dashboard

Raspberry pi dashboard

This is what we did to setup a few dashboards at platanus

You'll need

  • Raspberry Pi
  • Dashing Service
  • Wifi stick (optional)
@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