Skip to content

Instantly share code, notes, and snippets.

View metbril's full-sized avatar

metbril metbril

View GitHub Profile
#!/bin/sh
# Implementation of http://tantek.pbworks.com/NewBase60
# License: http://creativecommons.org/licenses/by-sa/3.0/
n="$1"
s=''
m='0123456789ABCDEFGHJKLMNPQRSTUVWXYZ_abcdefghijkmnopqrstuvwxyz'
if [ -z "$n" ] || [ "$n" -eq "0" ]; then
echo 0
@bobes
bobes / ril_to_instapaper.rb
Created April 13, 2011 06:18
Import your ReadItLater bookmarks into Instapaper
#!/usr/bin/env ruby
# 1. export your RIL bookmarks
# 2. save this file to the same directory where your ril_export.html is
# 3. change username and password in the script bellow
# 4. run 'ruby ril_to_instapaper.rb' in terminal
require "cgi"
require "net/http"
require "net/https"
@jeredb
jeredb / Log to Day One.scpt
Created February 24, 2012 19:26
Based on Brett Terpstra's Log Taskpaper Archives to Day One, except for Omnifocus.
(*
Jered Benoit
jeredb.com
Omnifocus -> Day One Daily Completed Task Log
Based upon [Version 1.0] [1] of [OmniFocus - Weekly Project Report Generator] [2]
Originally Authored by Chris Brogan and Rob Trew
February 5, 2012
@jeromer
jeromer / compassbearing.py
Last active February 21, 2024 13:31
compass bearing between two points in Python
# LICENSE: public domain
def calculate_initial_compass_bearing(pointA, pointB):
"""
Calculates the bearing between two points.
The formulae used is the following:
θ = atan2(sin(Δlong).cos(lat2),
cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong))
@BjornW
BjornW / solarize.sh
Created May 13, 2012 15:13 — forked from codeforkjeff/solarize.sh
shell script for setting gnome-terminal color palette to use Solarized theme
#!/bin/sh
#
# Shell script that configures gnome-terminal to use solarized theme
# colors. Written for Ubuntu 11.10, untested on anything else.
#
# Solarized theme: http://ethanschoonover.com/solarized
#
# Adapted from these sources:
# https://gist.github.com/1280177
# http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/
@wcaleb
wcaleb / duesoon.sh
Created May 15, 2012 15:54
A shell script to remind me of tasks that are due soon, using this system: http://wcm1.web.rice.edu/plain-text-gtd.html
#!/bin/sh
TODAY=$(date +%m)
FILE=~/.duesoon
# This may be more complex than need be, but it permits months with or without leading zeroes
let THISMO=$TODAY-0
if [ $THISMO = 12 ]; then
let NEXTMO=01
else
@davidnunez
davidnunez / omnifocus_randomly_defer_next_review_date
Created May 24, 2012 01:11
Script that resets Omnifocus project's next review date to a random day in the next week (ex. to distribute review dates across the week)
tell application "OmniFocus"
tell document 1
tell (first document window whose index is 1)
set SelectedItemInMainView to selected trees of content
repeat with i from 1 to (count of SelectedItemInMainView)
set theSelectedTask to value of item i of SelectedItemInMainView
@davidnunez
davidnunez / gist:2795676
Created May 26, 2012 23:59
Script that copies selected items in omnifocus to a format suitable for pasting in my nvalt system
property newContextName : "txfr" --context the item will change to if changeContext = true
tell application "Finder"
set the clipboard to ""
end tell
tell application "OmniFocus"
@paulruescher
paulruescher / Extend Recent Posts
Created June 26, 2012 19:02
Used this to change the output of WordPress' Recent Posts Widget
/**
* Extend Recent Posts Widget
*
* Adds different formatting to the default WordPress Recent Posts Widget
*/
Class My_Recent_Posts_Widget extends WP_Widget_Recent_Posts {
function widget($args, $instance) {
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"