Skip to content

Instantly share code, notes, and snippets.

View drewlustro's full-sized avatar
💭
on windoze

Drew Lustro drewlustro

💭
on windoze
View GitHub Profile
@drewlustro
drewlustro / raspi-util-functions.sh
Created September 8, 2016 00:22
Dump/Restore Raspberry Pi SD card image on OS X terminal
# subset of functions.sh from https://github.com/drewlustro/dotfiles
# put in your .bash_profile or .zshrc
function toolbelt-raspi-image-dump() {
local now=$(date +"%Y-%m-%d__%H-%M-%S");
local host=${2:="raspi"};
local diskNumber=${1:--1}
local bs="1M"
local cmd="sudo dd if=/dev/rdisk$1 bs=$bs | gzip > ~/Desktop/$host-$now.pi.gz"
local usage="Usage: $0 [sdCardDiskN] [hostname='raspi']"
@drewlustro
drewlustro / lowercase-files.sh
Created August 25, 2016 00:04
Batch change filename/extension to lowercase
# http://stackoverflow.com/questions/7787029/how-do-i-rename-all-files-to-lowercase
for f in *; do mv "$f" "$f.tmp"; mv "$f.tmp" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done
@drewlustro
drewlustro / install.sh
Last active February 15, 2016 05:33 — forked from ewnd9/install.sh
google's deepdream ubuntu installation
# sources
# http://www.scipy.org/install.html
# http://sohliloquies.blogspot.ru/2015/07/setting-up-deep-dream-google-researchs.html
# https://github.com/BVLC/caffe/wiki/Ubuntu-14.04-VirtualBox-VM
# ~2gb dependencies
mkdir deep-dream && cd deep-dream
sudo apt-get install -y subversion cmake
@drewlustro
drewlustro / brace.js
Last active January 4, 2016 10:19
Brace.Object is undefined in chapter.js -- apologies that Object needs to be fully renamed to SceneObject. Please ignore that.
(function() {
Brace = {};
define('brace/brace', ['THREE', 'brace/base', 'brace/publisher', 'brace/chapter', 'brace/app', 'brace/object', 'brace/settings'],
function (THREE, Base, Publisher, Chapter, App, SceneObject, Settings) {
Base(Brace);
Publisher(Brace);
SceneObject(Brace);
@drewlustro
drewlustro / base.js
Last active January 4, 2016 10:18
I'm trying to create an AMD-style library called "Brace" using requirejs and I'm having issues. I try to make the master Brace object and decorate it with classes. On build, "Brace" is undefined for the Brace.Base class. How do I attach class modules to the master Brace object? I'm surely missing something here about exports or global scope or s…
// brace/brace.js
(function(Brace) {
define('brace/base',
['THREE'],
function (THREE) {
Base = function() {
Object.call(this);
@drewlustro
drewlustro / Gruntfile.js
Created January 14, 2014 00:11
Gruntfile.js with attempted CORS middleware in connect:livereload:options
// Generated on 2013-12-19 using generator-webapp 0.4.6
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
name: "Oxford102CaffeNet"
input: "data"
input_dim: 10
input_dim: 3
input_dim: 227
input_dim: 227
force_backward: true
layers {
name: "conv1"
type: CONVOLUTION
@drewlustro
drewlustro / gist:d8bd9ab0ff25c8c83566
Created March 1, 2015 10:17
vmhgfs on ubuntu 14.10 install fails to compile
drew@ubuntu:~$ cd Desktop/
drew@ubuntu:~/Desktop$ ls
vmware-tools-distrib
drew@ubuntu:~/Desktop$ cd vmware-tools-distrib/
drew@ubuntu:~/Desktop/vmware-tools-distrib$ ls
bin doc etc FILES INSTALL installer lib vmware-install.pl
drew@ubuntu:~/Desktop/vmware-tools-distrib$ clear

drew@ubuntu:~/Desktop/vmware-tools-distrib$ sudo ./vmware-install.pl
[sudo] password for drew:
@drewlustro
drewlustro / demo.nginx.conf
Last active August 29, 2015 14:11
Simple gulp-rsync deploy
server {
listen 80;
root /sites/SOME-SITE-ROOT-DIRECTORY/staging0;
index index.html index.htm;
server_name staging0.jessechorng.com;
location / {
try_files $uri $uri/ /index.html /index.htm;