Skip to content

Instantly share code, notes, and snippets.

View johndryan's full-sized avatar

John Ryan johndryan

View GitHub Profile
# =======================================
# OS X — ONE CLICK — EJECT ALL DISKS
# =======================================
# Open Script Editor on OS X
# Copy and paste this file in
# Pre-High Sierra: Save As > Application
# High Sierra: Export > File Format > Application
# Name it "Eject All Disks"
# Drag created application to Dock
# Now you can eject all external disks with one click from Dock
@mattfelsen
mattfelsen / setup.sh
Last active August 29, 2015 14:08
Local Projects openFrameworks New Project Setup
#!/bin/bash
#
# NOTE: The openFrameworks folder structure (particularly with regard to the projectGenerator)
# has changed since this script was written, so this will probably not work!
# (The parts about creating a new project toward the end, at least.)
#
#
# usage:
-- csipttc_unisiwc_ctpttfwttc.app
-- Copy Selected Items Path To The Clipboard Unless Nothing Is Selected In Which Case Copy The Path To The Foremost Window To The Clipboard
on makeAndCopyLinkFromPath(myPath)
if myPath starts with "/Volumes/" then
set dirStructure to ((characters 9 thru -1 of myPath) as string)
set strHTML to quoted form of ("<a style='font-family:helvetica' href=\"smb://Guest::@lp-vault" & dirStructure & "\">" & myPath & "</a>") --double :: bc otherwise it disappears?
--tell application "Finder" to display dialog strHTML
do shell script "echo " & strHTML & " | textutil -format html -convert rtf -stdin -stdout | pbcopy -Prefer rtf"
else
@ltrebing
ltrebing / delicious-bookmark
Created January 8, 2014 00:54
A Delicious bookmarklet that opens an old-style new tab (or window) instead of putting a fancy inline frame thing on the page.
javascript:(function(e,t){window.open(%22https://delicious.com/save?url=%22+encodeURIComponent(e.location.href)+%22&title=%22+encodeURIComponent(e.document.title)+%22&note=%22+encodeURIComponent(%22%22+e.getSelection()?e.getSelection():e.document.getSelection?e.document.getSelection():e.document.createRange().text)+%22&v=1.1%22,%22_blank%22);})(window)
@ArupSen
ArupSen / python_boilerplate.py
Created December 17, 2012 15:46
Basic boilerplate for a python script file
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""[application description here]"""
def main():
pass
if __name__ == '__main__': main()
@rnapier
rnapier / fix-xcode
Last active March 18, 2022 01:17
Links Xcode SDKs from the /SDKs directory (which you maintain yourself)
#!/usr/bin/python
# fix-xcode
# Rob Napier <robnapier@gmail.com>
# Script to link in all your old SDKs every time you upgrade Xcode
# Create a directory called /SDKs (or modify source_path).
# Under it, put all the platform directories:
# MacOSX.platform iPhoneOS.platform iPhoneSimulator.platform
# Under those, store the SDKs:
@paulgroves
paulgroves / rewrite.script
Created March 31, 2012 10:07
Textpattern rewrite rules for Zeus webserver
# Zeus webserver version of basic Textpattern mod_rewrite rules
map path into SCRATCH:path from %{URL}
look for file at %{SCRATCH:path}
if exists then goto END
look for dir at %{SCRATCH:path}
if exists then goto END
# Do not apply to admin section i.e /textpattern
match URL into $ with ^/textpattern.*$
if matched then goto END
match URL into $ with ^/css.php?.*$
@minhajuddin
minhajuddin / README.md
Created December 21, 2011 03:29
Script to retrieve content from google cache
.mouse, #preview{
position: absolute;
background-repeat: no-repeat;
height: 22px;
min-width: 15px;
z-index: 100;
}
.mouse{
background-image: url('../images/cursor.png');