Skip to content

Instantly share code, notes, and snippets.

View Sitebase's full-sized avatar
🤘

Wim Mostmans Sitebase

🤘
View GitHub Profile
@jordansissel
jordansissel / site.pp
Created October 15, 2010 19:56
Simplest example of a masterless puppet invocation using module paths
include foo
@jhickner
jhickner / reload_chrome.sh
Created November 15, 2012 22:37
Reload Chrome then refocus iTerm
#!/bin/sh
exec <"$0" || exit; read v; read v; exec /usr/bin/osascript - "$@"; exit
-- the above is some shell trickery that lets us write the rest of
-- the file in plain applescript
tell application "Google Chrome"
activate
tell application "System Events"
tell process "Google Chrome"
@jellea
jellea / gist:3438926
Created August 23, 2012 17:18
Webcam snapshot on every git commit
#!/bin/bash
#
# This script will make a webcam snapshot every commit. The jpg file will have
# the commit id as the filename.
#
# This script requires imagesnap. Install with: 'brew install imagesnap'
#
# Put this file in the '.git/hooks/' name it 'post-commit' and chmod it by:
# 'chmod +x .git/hooks/post-commit'
#
@nickytoh
nickytoh / iCloud API Demo in Node.js
Last active September 6, 2021 03:11
Request Contact List From iCloud
var uuid = require('node-uuid'),
https = require('https');
function iCloud(appleId, password) {
this.urls = {
"version" : "https://www.icloud.com/system/version.json",
"validate": "/setup/ws/1/validate?clientBuildNumber={0}&clientId={1}",
"login": "/setup/ws/1/login?clientBuildNumber={0}&clientId={1}"
}
@du-song
du-song / Disable Notification Center Alerts and Banners.applescript
Created February 5, 2013 03:26
Disable & Re-Enable Notification Center Alerts and Banners
do shell script "defaults write ~/Library/Preferences/ByHost/com.apple.notificationcenterui.*.plist doNotDisturb -boolean true"
set theDate to quoted form of (do shell script "date +\"%Y-%m-%d %I:%M:%S +0000\"")
do shell script "defaults write ~/Library/Preferences/ByHost/com.apple.notificationcenterui.*.plist doNotDisturbDate -date " & theDate
do shell script "killall NotificationCenter"
@coopermaruyama
coopermaruyama / vendor-ffmpeg-heroku
Created October 27, 2012 08:39
Install FFMpeg on heroku (Rails)
## Get FFMpeg working on heroku by building binaries using vulcan
gem install vulcan
vulcan create foo
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
@n1k0
n1k0 / Howto.md
Created October 1, 2012 17:59
CasperJS test cli hooks example

Put test1.js and test2.js into a tests/ directory, then run the suite:

$ casperjs test tests/ --pre=pre.js --includes=inc.js --post=post.js
Test file: /Users/nperriault/tmp/pre-inc/pre.js                                 
Hey, I'm executed before the suite.
Test file: /Users/nperriault/tmp/pre-inc/tests/test1.js                         
# this is test 1
Hi, I've been included.
PASS Subject is strictly true
@devgeeks
devgeeks / s3-phonegap-upload.js
Created November 27, 2012 19:47
S3 direct upload
var options = new FileUploadOptions();
options.fileKey="fileupload";
var time = new Date().getTime();
var userId = getUserId(); // In my case, Parse.User.current().id;
var fileName = userId+"-"+time+".jpg";
options.fileName = fileName;
options.mimeType ="image/jpeg";
options.chunkedMode = false;
var uri = encodeURI("https://BUCKET_NAME.s3.amazonaws.com/");
@harith
harith / shellmarks.sh
Last active September 18, 2022 07:50
Utilities to let you easily reach frequently visited but deeply nested directories.
# Utilities for quickly accessing frequently used directories in bash.
# Usage:
# $ cd /path/to/project/src/
# $ mark code # Will create a new shortcut.
# # Becomes interactive if a shortcut already exists
# # m is an alias for mark. You can also `m code`
#
# $ code # From now on, running this anywhere in the shell
# # will put you in /path/to/project/src/code
@olivierlacan
olivierlacan / launch_sublime_from_terminal.markdown
Created September 5, 2011 15:50
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation