Skip to content

Instantly share code, notes, and snippets.

@rzwitserloot
rzwitserloot / radio
Created October 15, 2009 03:28
This script will play radio and should work on macs and linux computers if you have VLC installed. Better than iTunes, in that it works with more stations, and doesn't clutter your media list.
#!/bin/bash
# author: Reinier Zwitserloot
# this script is in the public domain. I relinquish all rights.
# source: http://gist.github.com/210643
# Plays various radio channels, using VLC. Run me from a terminal to see radio station options.
# If your radio skips a lot, you need to suid 'renice'. If you don't know what that means, don't try it yourself; it has serious security implications.
# For this to work, you need VLC. On debian / ubuntu: apt-get install vnc
@eculver
eculver / Auto-refresh bookmarklet
Created January 2, 2010 01:02
Auto-refresh bookmarklet
// origin: http://www.google.com/support/forum/p/Chrome/thread?tid=1a37ccbdde5902fd&hl=en
javascript:
timeout=prompt("Set timeout [s]");
current=location.href;
if(timeout>0)
setTimeout('reload()',1000*timeout);
else
location.replace(current);
function reload(){
@andrewle
andrewle / center_window.sh
Created April 19, 2010 06:37
Center the top most window using AppleScript
#!/usr/bin/env bash
# Center the top most window using AppleScript
# I call this up quickly using Quicksilver and run it as a terminal
# script because (surprise!) it's faster than running as native AppleScript
osascript -e "
tell application \"Finder\"
set screenSize to bounds of window of desktop
set screenWidth to item 3 of screenSize
end tell
@subtleGradient
subtleGradient / appify
Created November 11, 2010 16:03
appify. Create the simplest possible mac app from a shell script
#!/usr/bin/env bash
#
# url : https://gist.github.com/672684
# version : 2.0.2
# name : appify
# description : Create the simplest possible mac app from a shell script.
# usage : cat my-script.sh | appify MyApp
# platform : Mac OS X
# author : Thomas Aylott <oblivious@subtlegradient.com>
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@rpavlik
rpavlik / fix_homebrew.rb
Created January 6, 2011 20:32 — forked from mxcl/install_homebrew.markdown
Fix permissions on /usr/local for Homebrew
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@ded
ded / domready.js
Created February 24, 2011 08:46
Smallest x-browser DOM Ready, ever
function r(f){/in/(document.readyState)?setTimeout(r,9,f):f()}
// Injecting JavaScript
// Basic compact
document.body.appendChild(document.createElement("script")).src="foo.js"
// Function wrapped
(function(d){d.body.appendChild(d.createElement("script")).src="foo.js"})(document)
// With "with"
with(document){body.appendChild(createElement("script")).src="foo.js"}
// Injecting CSS
@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@irae
irae / _Stay_standalone.md
Last active January 29, 2024 12:38 — forked from kylebarrow/example.html
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.