Skip to content

Instantly share code, notes, and snippets.

View gabeio's full-sized avatar

Gabe De Luca gabeio

View GitHub Profile
# ~/.osx — http://mths.be/osx
# root check
if [[ $EUID -ne 0 ]]; then
echo "################################";
echo "## YOU ARE NOT RUNNING AS ROOT #";
echo "################################";
echo "#";
echo "# USAGE: sudo $0";
exit;
sudo -v
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist #disable spotlight
sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search #disable spotlight
defaults write -g ApplePressAndHoldEnabled -bool false #disable accent popup ?(maybe)
defaults write NSGlobalDomain KeyRepeat -int 0 #faster keyrepeat ?(maybe)
#defaults write com.apple.finder AppleShowAllFiles TRUE #show hidden files
#!/usr/bin/env bash
# ~/.osx — http://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@gabeio
gabeio / app.js
Created August 2, 2013 06:09 — forked from dbainbridge/app.js
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, http = require('http');
var app = express();
var server = app.listen(3000);
@gabeio
gabeio / LICENSE.txt
Created October 11, 2013 05:20 — forked from jed/LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
#! /usr/bin/env python
import fileinput
import argparse
from operator import itemgetter
parser = argparse.ArgumentParser()
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int)
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+')
args = parser.parse_args()
@gabeio
gabeio / app.js
Created November 1, 2014 03:08
node kill switch
process.on('SIGINT', function() {
/* shutdown here */
})
@gabeio
gabeio / bash.sh
Created November 15, 2014 20:23
Convert ISO to IMG for bootable usb drives
hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso
mv ~/path/to/target.img.dmg ~/path/to/target.img #hdiutil likes dmgs...
sudo dd if=~/path/to/target.img of=/dev/rdisk{int} #must be disk and not partition for bootable
@gabeio
gabeio / final.md
Last active August 29, 2015 14:11
Math 2526 Applied Statistics Study Guide
@gabeio
gabeio / app.js
Last active August 29, 2015 14:12
bower static server
var express = require('express');
var serveStatic = require('serve-static');
var app = express();
app.use('/static', serveStatic(__dirname + '/public'));
app.use('/bower_components', serveStatic(__dirname + '/bower_components'));
if (process.env.HTTP != null || process.env.PORT != null) {
port = process.env.HTTP || process.env.PORT;
console.log('Server started on port ' + port + ' at ' + new Date(Date.now()));
server = app.listen(port);
} else {