This file contains 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 'rubygems' | |
require 'sequel' | |
require 'fileutils' | |
require 'yaml' | |
# NOTE: This converter requires Sequel and the MySQL gems. | |
# The MySQL gem can be difficult to install on OS X. Once you have MySQL | |
# installed, running the following commands should work: | |
# $ sudo gem install sequel | |
# $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config |
This file contains 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 'cgi' | |
module Xorcode | |
module Liquid | |
class QrCodeTag < ::Liquid::Tag | |
def initialize(tag_name, id, tokens) | |
@url = "https://market.android.com/details?id=#{id.strip}" | |
super | |
end |
This file contains 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
desc "Deploy to production environment" | |
task :deploy do | |
require 'net/scp' | |
system "rm -Rf ./_site" | |
system "jekyll --production --no-auto --no-future" | |
username = ask("Username: ", nil) { |q| q.echo = true } | |
system "rsync --progress --stats --compress --recursive --times --links --delete --force ./_site/ #{username}@xorcode.com:/home/xorcode.com/_site/" | |
end # task :deploy |
This file contains 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 'bitly' | |
module Jekyll | |
class BitlyFilterCache | |
def initialize | |
@result_cache = {} | |
config = Jekyll.configuration({}) | |
@username = config['bitly']['username'] | |
@key = config['bitly']['api_key'] | |
Bitly.use_api_version_3 |
This file contains 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/sh | |
#Change these settings to match your system | |
ACCESS_KEY='YOUR_ACCESS_KEY' | |
ACCESS_SECRET='YOUR_SECRET_KEY' | |
BUCKET="YOUR_BUCKET_NAME" | |
DATABASE="YOUR_DATABASE_NAME" | |
# Do not change anything below this line | |
tool=`which s3multiput s3cmd` |
This file contains 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
1 leek plant | |
1 bushel of asparagus | |
2 cups veggie broth | |
1 table spoon Butter | |
1 table spoon olive oil | |
Salt & pepper | |
First cut leek and asparagus into smaller less then 2 inch pieces. | |
Melt butter with olive oil |
This file contains 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/sh | |
available=$(free --mega -tw | grep "Total:" | awk '{print $4}') | |
ps -ylC httpd --sort:rss | awk -v avail="$available" '{ s += $8; } END { print "Average Size:", s/(NR-1)/1024, "MB,", NR-1, "Processes, Total usage:", (s/(NR-1)/1024)*(NR-1), "MB, Max Servers:", avail/(s/(NR-1)/1024) }' |
This file contains 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
[alias] | |
st = status | |
ci = commit | |
br = branch | |
co = checkout | |
df = diff | |
sync = !sh -c 'git pull && git diff --quiet HEAD || (git commit $1 && git push)' - | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; sublime_text `f`" | |
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`" |
This file contains 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
{ | |
"font_size": 13, | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"use_tab_stops": false, | |
"word_wrap": false, | |
"highlight_line": true, | |
"caret_style": "phase", | |
"match_brackets_angle": true, | |
"default_line_ending": "unix", |
OlderNewer