Instantly share code, notes, and snippets.

View loop.js
<script src=""></script>
<script src=""></script>
// This is where stuff in our game will happen:
var scene = new THREE.Scene();
// This is what sees the stuff:
var aspect_ratio = window.innerWidth / window.innerHeight;
var camera = new THREE.PerspectiveCamera(75, aspect_ratio, 1, 10000);
View tube_loop.js
// start at, stop before 20, increase i by 1
for (var i=0;i<20; i += 1) {
var cover = new THREE.MeshNormalMaterial();
var cylinder = new THREE.CylinderGeometry(125, 125, 125, 30);
var tube = new THREE.Mesh(cylinder, cover);
// x values changes with the i value so they don't overlap
tube.position.set(-1000 + i*300, 0, -50);
VBoxManage internalcommands createrawvmdk -filename ~/usb.vmdk -rawdisk /dev/disk1
View R: Predictions with a Linear Model
> house.size <- c(1400, 2400, 1800, 1900, 1300, 1100)
> house.cost <- c(112000, 192000, 144000, 152000, 104000, 88000)
> plot(house.size, house.cost)
> fit <- lm(house.cost ~ house.size)
> abline(fit)
> predict(fit, newdata=data.frame(house.size=c(1300)),
View Lending Club API Curl
# Request account summary in CSV
curl -v -H "Authorization: <API KEY>" -H "Accept:text/plain" -XGET<ACCOUNT ID>/summary
# Get current listings
curl -v -H "Authorization: <API KEY>" -H "Accept:text/plain" -XGET
View R Snippets
# Split into training and test sets
trainIndex <- createDataPartition(students$grade, p = 0.9,
list = FALSE,
times = 1)
studentsTrain <- students[ trainIndex,]
studentsTest <- students[-trainIndex,]
# Create a proportion table
View git branch cleanup
Rename branch
git branch -m <oldName> <newName>
Delete local branch
git branch -D <branchName>
Delete local and remote branch
git push origin --delete <branchName>
Delete remote reference from local repo
View gist:c43a80a56d5931e09bd2
Remove config entries:
git config -f .git/config --remove-section submodule.$submodulepath
git config -f .gitmodules --remove-section submodule.$submodulepath
Remove directory from index:
git rm --cached $submodulepath
Delete unused files:
rm -rf $submodulepath
rm -rf .git/modules/$submodulepath