Skip to content

Instantly share code, notes, and snippets.

View warthurton's full-sized avatar

Wayne Arthurton warthurton

View GitHub Profile
@nathos
nathos / amznshortener.js
Created May 25, 2010 20:39
AmznShortener - Javascript bookmarket source for an Amazon.com short-link generator.
(function(){
var aff = 'nathos-20'; // replace 'nathos-20' with your Amazon affiliate ID, including the '-20'
if (!document.getElementById('ASIN')) {
alert('Can\'t find an Amazon product ID');
return;
}
var asin = document.getElementById('ASIN').value;
prompt(
'Here is the shortened affiliate link:',
'http://amzn.com/' + asin + '?tag=' + aff);
@nathos
nathos / lorem.rb
Created November 11, 2010 21:24
LoremHelper - a placeholder content generator for Webby
# LoremHelper - a placeholder content generator for Webby
# =======================================================
# based on Travis Dunn's Frank - lorem.rb:
# - https://github.com/blahed/frank/blob/master/lib/frank/lorem.rb
# - original license: https://github.com/blahed/frank/blob/master/LICENSE
#
# LoremHelper creates placeholder content for your Webby [http://webby.rubyforge.org/] projects.
# It's great for quickly prototyping/wireframing a site.
#
# USAGE:
@BenWard
BenWard / pinboard-full.js
Created January 29, 2011 07:47
A smarter bookmarklet for Pinboard.in; wraps selected text in <blockquote> tags, keeps variables out of the global scope, supports filling tags from rel="tag" markup in the page, and titles from hAtom entry titles.
(function() {
// Change `silent` to true to invoke the promptless, self-closing
// version of the bookmarklet.
var silent = false;
var url = location.href;
var title = document.title;
// Look for a single hAtom entry on the page, and iff one is found, extract
// the entry-title in place of the document title:
@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@jpcody
jpcody / upload-clipboard.rb
Created September 3, 2011 01:06
Save clipboard contents as private gist using Alfred.app
# It'd be great to get this running via AppleScript and sans Alfred if anyone with more knowledge than me knows how :)
### STEP 1
#!/bin/sh
# Save this file as /bin/rvm_ruby, and do chmod 755 /bin/rvm_ruby
# to give it the proper permissions
# From http://www.aeonscope.net/2011/05/29/connecting-alfred-to-bitly-via-ruby/
if [[ -s ~/.rvm/scripts/rvm ]]; then
@bergerjac
bergerjac / ControlHelpers.cs
Created March 18, 2012 16:23
LightSwitch: Strong Type FindControl
// Client
using System;
using System.Diagnostics;
using System.Windows.Controls;
using Microsoft.LightSwitch.Presentation;
using Microsoft.LightSwitch.Presentation.Extensions;
namespace LightSwitchApplication
{
@btoone
btoone / curl.md
Last active May 14, 2024 19:32
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@Thermionix
Thermionix / auth-basic.conf
Last active November 4, 2021 00:56
nginx reverse proxy for sickbeard, couchpotato etc.
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
@brettkelly
brettkelly / main.py
Created November 14, 2012 20:04
Share a single note
def shareSingleNote(authToken, noteStore, userStore, noteGuid, shardId=None):
"""
Share a single note and return the public URL for the note
"""
if not shardId:
shardId = getUserShardId(authToken, userStore)
if not shardId:
raise SystemExit
try:
# update_timezones.py
# Aleksandr Pasechnik
#
# Goes through the Day One jounal and sets the Time Zone of each entry that
# doesn't already have one to the value of the *timezone* variable. Makes a
# backup copy of each entry it modified by adding a '.tzbak' to the filename.
# Ignores any entry that already has a '.tzbak' version.
#
# NOTE: base_dir may need to be adjusted to the correct Journal_dayone location
# NOTE: It is probably a good idea to have a full journal backup just in case