Skip to content

Instantly share code, notes, and snippets.

@cdated
cdated / loop.js
Created August 10, 2016 19:58
Full Loop
<body></body>
<script src="http://gamingJS.com/Three.js"></script>
<script src="http://gamingJS.com/ChromeFixes.js"></script>
<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);
@cdated
cdated / tube_loop.js
Last active August 9, 2016 13:17
Tube Loop
// 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);
scene.add(tube);
@cdated
cdated / README
Created May 12, 2016 03:46
Create VMDK Pointing to USB
VBoxManage internalcommands createrawvmdk -filename ~/usb.vmdk -rawdisk /dev/disk1
> 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)), se.fit=TRUE)
$fit
1
# Request account summary in CSV
curl -v -H "Authorization: <API KEY>" -H "Accept:text/plain" -XGET https://api.lendingclub.com/api/investor/v1/accounts/<ACCOUNT ID>/summary
# Get current listings
curl -v -H "Authorization: <API KEY>" -H "Accept:text/plain" -XGET https://api.lendingclub.com/api/investor/v1/loans/listing
@cdated
cdated / R Snippets
Last active October 19, 2015 03:25
# 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
prop.table(table(loansTrain$default))
@cdated
cdated / git branch cleanup
Last active September 10, 2015 20:15
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
@cdated
cdated / gist:c43a80a56d5931e09bd2
Created September 10, 2015 16:00
Remove git submodules
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
Commit
Delete unused files:
rm -rf $submodulepath
rm -rf .git/modules/$submodulepath