Skip to content

Instantly share code, notes, and snippets.

View davidandreoletti's full-sized avatar

David Andreoletti davidandreoletti

View GitHub Profile
tell application "Aperture"
activate
# Once the folder hierarchy is created, the photos must be
# moved into a project. This is the default name of the project.
set DEFAULT_PROJECT_NAME to "Photos"
set curSel to (get selection)
# Force the user to pick a selection. The parent of the selection is the container
# we'll grab all the images from to organize into the folder hierarchy.
if curSel is {} then
error "Please select a project to organize"
@lusis
lusis / gist:1047214
Created June 26, 2011 03:58 — forked from rowan-m/gist:1026918
update jenkins Updatecenter from CLI
$ java -jar jenkins-cli.jar -s http://localhost:9000 install-plugin findbugs
findbugs is neither a valid file, URL, nor a plugin artifact name in the update center
No update center data is retrieved yet from: http://updates.jenkins-ci.org/update-center.json
findbugs looks like a short plugin name. Did you mean 'null'?
# Specifying a full URL works!
$ java -jar jenkins-cli.jar -s http://localhost:9020 install-plugin http://updates.jenkins-ci.org/download/plugins/AdaptivePlugin/0.1/AdaptivePlugin.hpi
# Get the update center ourself
@tomjnixon
tomjnixon / paswitch.sh
Last active May 28, 2024 13:27
PulseAudio output switcher script
#!/bin/bash
# Script to switch all programs to a specific sink. Why this isn't easy, i
# don't know.
# This script takes a single argument, the sink name, index, or alias (defined
# below).
# To make this work, you will need to:
# - In /etc/pulse/default.pa:
@drj42
drj42 / org-mode-reference-in.org
Created February 6, 2012 23:53
This is a cheat sheet for Emacs org-mode... in org-mode format!
@dupuy
dupuy / README.rst
Last active June 25, 2024 15:05
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@ef4
ef4 / usb-headset.sh
Created March 18, 2012 15:08
Automatically switch all PulseAudio streams to a USB headset
#!/bin/bash
# Adapted from Erik Johnson's script at
# http://terminalmage.net/2011/11/17/setting-a-usb-headset-as-the-default-pulseaudio-device/
#
# Updated by Edward Faulkner <ef@alum.mit.edu> to move existing
# streams and eliminate the extra fork script.
# You'll need to change these to point at your headset device.
OUTPUT="alsa_output.usb-Generic_FREETALK_Everyman_0000000001-00-Everyman.analog-stereo"
@JonathanNye
JonathanNye / gist:2229968
Created March 28, 2012 19:55
Simple bottom "stroke" XML drawable for Android View backgrounds
<!-- This produces a 1.5dp stroke along the bottom of a View. It works by drawing the stroke color as the background of the View, then the background color on top, offset up by 1.5dp. Unfortunately, this approach
only works if you have solid color backgrounds. For transparency, you'll have to use a 9patch. -->
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item >
<shape android:shape="rectangle">
<solid android:color="STROKE_COLOR_HERE"/>
@hartym
hartym / git-stash-grep
Created May 3, 2012 09:45 — forked from netshade/gist:1125810
git stash grep (bash)
stashgrep() {
for i in `git stash list | awk -F ':' '{print $1}'`; do
git stash show -p $i | grep -H --label="$i" "$1"
done
}
@JoshuaEstes
JoshuaEstes / 000-Cheat-Sheets.md
Last active May 1, 2024 04:03
Developer Cheat Sheets for bash, git, gpg, irssi, mutt, tmux, and vim. See my dotfiles repository for extra info.
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active June 21, 2024 07:34
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1