This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NOTIFY_FILE=~/.irssi/fnotify | |
# clear the file, at shutdown assuming we have showed all the notfications so | |
# far | |
trap "> $NOTIFY_FILE" SIGINT | |
# send notifications to the terminal-notifier | |
tail -f $NOTIFY_FILE | \ | |
while read heading message; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Outside in configuration | |
class ObjectBuilder | |
def initialize() | |
someMoreDefaults = {} | |
end | |
def setFoo foo | |
foo = foo | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ClearQuickfixList() | |
call setqflist([]) | |
endfunction | |
command! ClearQuickfixList call ClearQuickfixList() | |
nmap <leader>cf :ClearQuickfixList<cr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map <leader>nn :edit ~/Dropbox/Notes/ | |
function SearchNotes() | |
let search = input("Search Notes: ") | |
Ag search -f ~/Dropbox/Notes | |
endfunction | |
map <leader>sn :call SearchNotes()<cr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Print OneNote to PDF | |
# Extract Text with | |
# http://www.extractpdf.com/ and name Main.txt | |
data = File.read "Main.txt" | |
data = data.split("\f") | |
data.each do |el| | |
next if el.empty? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (null !== getenv("DATABASE_URL")) { | |
$db = parse_url(getenv("DATABASE_URL")); | |
define("DB_NAME", trim($db["path"],"/")); | |
define("DB_USER", $db["user"]); | |
define("DB_PASSWORD", $db["pass"]); | |
define("DB_HOST", $db["host"]); | |
define('DB_CHARSET', 'utf8'); | |
define('DB_COLLATE', ''); | |
} else { | |
die("Your heroku DATABASE_URL does not appear to be correctly specified."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "dotenv/tasks" | |
require "uri" | |
namespace :development do | |
desc "run server" | |
task :server => :dotenv do | |
sh "php -S localhost:9292 " | |
end | |
desc "open a local database shell" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Functions to handle transition from Tumblr to Wordpress | |
* author: philipp fehre <philipp@fehre.co.uk | |
* | |
* The goal ist to make imported tumbler posts work along the normal permalinks | |
* generated by tumblr | |
* | |
* This works for posts imported via http://tumblr2wordpress.benapps.net | |
* exported file containing the tumblr post ids in the post_name field. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Output is a script which installs all currently installed packages from | |
# homebrew, including those from tabs. Packages no longer available are ignored | |
# Usage: | |
# ./backup-homebrew.sh > my-homebrew-backup.sh | |
# | |
# warnings about packages not available anymore will be generated | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var couchbase = require("couchbase") | |
var async = require("async") | |
var db = new couchbase.Connection({}) | |
// create insert function which expects just a callback | |
function insertFormObject(object) { | |
return function (cb) { | |
db.set(object._id, object.value, cb) | |
} |