Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bgreenlee's full-sized avatar

Brad Greenlee bgreenlee

View GitHub Profile
@bgreenlee
bgreenlee / Versioning.sh
Last active June 13, 2022 16:42
Automatic project versioning for Xcode using git commits & tags #xcode #git
#!/bin/sh
# Versioning.sh
#
# https://gist.github.com/791352 by Marc Hedlund
#
# Found at http://kswizz.com/post/2686511526/git-xcode-versioning and slightly
# modified.
# To install:
INSERT INTO 'snippets' ('title', 'body') VALUES
(':+1:', '👍'),
(':-1:', '👎'),
(':100:', '💯'),
(':1234:', '🔢'),
(':8ball:', '🎱'),
(':a:', '🅰'),
(':ab:', '🆎'),
(':abc:', '🔤'),
(':abcd:', '🔡'),
@bgreenlee
bgreenlee / DefaultKeyBinding.dict
Created February 28, 2012 14:53 — forked from indirect/DefaultKeyBinding.dict
Type unicode arrows and other cool things #unicode #osx
/* Put this in ~/Library/KeyBindings/DefaultKeyBinding.dict */
/* Based on a file from @eventualbuddha */
{
/* Modifier keys: start with C-m */
"^m" = {
"^ " = ("insertText:", "\U2423"); /* C-space space */
"^e" = ("insertText:", "\U21A9"); /* C-e return */
"e" = ("insertText:", "\U2305"); /* e enter */
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<!-- Online here: http://ejohn.org/files/bugs/isObjectLiteral/ -->
<title>isObjectLiteral</title>
<style>
li { background: green; } li.FAIL { background: red; }
iframe { display: none; }
</style>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<!-- Online here: http://ejohn.org/files/bugs/isObjectLiteral/ -->
<title>isObjectLiteral</title>
<style>
li { background: green; } li.FAIL { background: red; }
iframe { display: none; }
</style>
require 'open-uri' ; require 'rss/2.0' ; require 'cgi'; require 'openssl'
delicious_user='mattb'
instapaper_user='me@example.com'
instapaper_password='whatever'
$VERBOSE=nil
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE # lame, but effective; can't verify properly w/ open-uri in Ruby 1.8
RSS::Parser.parse(open("http://feeds.delicious.com/v2/rss/network/#{delicious_user}?count=15").read).items.each { |item| open("https://www.instapaper.com/api/add?username=#{instapaper_user}&password=#{instapaper_password}&url=#{CGI.escape(item.link)}&auto-title=1").read }