Skip to content

Instantly share code, notes, and snippets.

View johnelliott's full-sized avatar
🕳️
tunneling

John Elliott johnelliott

🕳️
tunneling
View GitHub Profile
@johnelliott
johnelliott / SuE Hangout #1 Notes
Created February 16, 2014 18:02
Startup Sngineering cs184 Hangout #1 Notes
From the chat:
Vijay Velagapudi 12:16 PM
no problem
To list all available commands enter "/?".
John Elliott 12:23 PM
https://dl.dropboxusercontent.com/u/23241016/startup%20engineering%20public/Lecture-all.pdf - Lecture Notes in one file on Dropbox
Nghia Hoang 12:23 PM
@johnelliott
johnelliott / gist:9041823
Last active August 29, 2015 13:56
Add Sublime Text CLI tool via symlink

add

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl 

along with something that checks for the presence of the app and for the presence of the existing symlink to my setup.sh or make a sublimetext setup.sh

This assumes the app is in the Applications folder and the symlink being made doesn't exist

@johnelliott
johnelliott / gist:8dac3894f9bed9f66037
Created June 19, 2014 00:30
Node File System (fs)
// File I/O is provided by simple wrappers around standard POSIX functions. To use this module do require('fs'). All the methods have asynchronous and synchronous forms.
// Watch for changes on filename. The callback listener will be called each time the file is accessed.
fs.watch('myfile.txt', function (event, filename) {
// fs.readFile asynchronously reads the entire contents of a file.
fs.readFile(file, {encoding:'utf8'}, function ( err, data ) {
if (err) throw err;
console.log(data);
});
});
@johnelliott
johnelliott / euler2.js
Last active August 29, 2015 14:08
Project Euler #2
// Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
// 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
// By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
// function makeFibsArray (howManyFibs) {
// var fibsArray = [1,2];
// for (var i = fibsArray.length - 1; i<=howManyFibs; i++) {
// fibsArray.push(findNextFibInArray(fibsArray));
var converter = {
usdExchangeRate: function(currencySymbol) {
var rates = {
'USD': 1,
'GBP': 0.63
}
return rates[currencySymbol];
},
dollarsToPounds: function(usdAmount) {
return usdAmount * this.usdExchangeRate('GBP');
@johnelliott
johnelliott / geom.js
Created November 7, 2014 14:48
Node-Jasmine setup using module.exports
function Rectangle(length, width) {
this.length = length;
this.width = width;
this.isSquare = function function_name(argument) {
return this.length === this.width;
};
this.area = function function_name(argument) {
return this.length * this.width;
};
this.perimeter = function function_name(argument) {
@johnelliott
johnelliott / gist:690905bb909347a56941
Last active August 29, 2015 14:08
Fix code school kill line and delete
// ==UserScript==
// @name monkeybusiness-codeschool
// @namespace https://github.com/johnelliott/monkeybusiness
// @include http://*.codeschool.com/*
// ==/UserScript==
//document.querySelector("div.CodeMirror textarea").focus();
// make script tag
var ninjaScript = document.createElement("script");
@johnelliott
johnelliott / despace.sh
Created December 4, 2015 19:23
bash script to remove spaces from Blender .mtl files and referenced asset files
#!/bin/bash
#set -x
remove_spaces() {
directory=$1
echo "Folder: $directory"
pushd $directory >/dev/null
find . -type f -not -name "*.obj" -not -name "*.mtl" | while read f; do
base_name=$(basename "$f")
spaceless=$(echo "$base_name" | tr -d " ")
@johnelliott
johnelliott / victor_bookshelf_2015
Last active January 18, 2016 18:04
Bret Victor's Bookshelf 2015 Categories.
http://worrydream.com/Shelf2015/
--
comics
animation
game design
type
media
the new medium
history of math
history of numbers and notation
@johnelliott
johnelliott / README.md
Last active September 19, 2023 13:53
http speed test with curl

cUrl speed test

Use

load up some urls into urls.txt

http://google.com/api/endpoint/1
http://google.com/api/other-endpoint/2

Run shell command: