Skip to content

Instantly share code, notes, and snippets.

@bluegraybox
bluegraybox / wizard.sh
Created August 31, 2011 21:49
Framework for shell script wizard.
#!/bin/bash
# Interactive wizard to walk the user through a process.
# Tracks steps completed; allows user to exit at any point and pick back up there.
function step1 () {
read -p "step 1 ok, $1? " ok
}
function step2 () {
@eins78
eins78 / DisableAdobeUpdates.command
Created September 28, 2010 19:15
Disable updates from Adobe on Mac OS X
echo "................................................................................" &&
echo "Hi! This will update 2 .plist files to disable Adobe Updates as recommended by" &&
echo "Adobe on http://kb2.adobe.com/cps/408/kb408711.html" &&
echo "and http://kb2.adobe.com/cps/404/kb404813.html." &&
echo "Therefore you have to enter your password here. Open this file in TextEdit to see for yourself if you don't trust me." &&
echo "................................................................................" &&
sudo defaults write /Library/Preferences/com.adobe.AdobeUpdater.Admin 'Disable.Update' -bool 'YES' &&
sudo defaults write /Library/Preferences/com.adobe.CSXSPreferences 'UpdatesAllowed' -string '0' &&
echo "Settings updated. Reboot and have fun."
echo "................................................................................"
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@isaacs
isaacs / comma-first-var.js
Created April 6, 2010 19:24
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",