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 | |
| # NOTE: requires ImageMagick | |
| # NOTE: will tint to the Solarized Dark default background scheme, as the iTerm background blend option didn't lower the contrast enough for me | |
| # NOTE: Optimised for a 1280x800 point screen (my 13" Retina MBP) | |
| set -e | |
| index=$[ 1 + $[ RANDOM % 10 ]] | |
| img=`curl https://unsplash.com/rss/ | xmllint --xpath '/rss/channel/item['$index']/image/url/text()' -` | |
| curl "$img" > ~/unsplash-latest.jpg && |
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
| #include "Blob.h" | |
| namespace sol { | |
| unsigned Object::used() const { | |
| BlobType type = (BlobType)_blob.getByte(0); | |
| switch (type) { | |
| case BL_INT: | |
| return Integer(_blob).used(); | |
| case BL_ARRAY: | |
| return Array::wrap(_blob).used(); |
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
| git ci --amend -m "`git show -s --format=%s` | |
| Force updated by Jenkins build $BUILD_ID" | |
| git push -f origin HEAD:master |
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
| #!/usr/bin/env ruby | |
| require 'builder' | |
| require 'sinatra' | |
| require 'action_view' | |
| include ActionView::Helpers::DateHelper | |
| get '/' do | |
| date = Time.parse(`git show -s --format=%ci`.chomp) |
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
| #!/usr/bin/env ruby | |
| require 'webrick' | |
| class NonCachingFileHandler < WEBrick::HTTPServlet::FileHandler | |
| def prevent_caching(res) | |
| res['ETag'] = nil | |
| res['Last-Modified'] = Time.now + 100**4 | |
| res['Cache-Control'] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0' | |
| res['Pragma'] = 'no-cache' | |
| res['Expires'] = Time.now - 100**4 |
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 | |
| if [ ! -z "$(find ~/.mail/*/INBOX -type f)" ]; then | |
| printf '📥 ' | |
| for box in `ls ~/.mail | grep -v temp`; do | |
| emails=$(find ~/.mail/$box/INBOX -type f | wc -l) | |
| [ $emails -ne 0 ] && printf '%s:%d ' ${box:0:1} $emails | |
| done | |
| printf '~\n' | |
| fi |
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/sh | |
| set -e | |
| LIST=$1; | |
| DUE=$2; | |
| WUNDERLISTDB="$HOME/Library/Containers/com.wunderkinder.wunderlistdesktop/Data/Library/Application Support/Wunderlist/WKModel.sqlite" | |
| if [ "$LIST" == 'Inbox' ]; then | |
| LID="AND ZTASKLIST is null"; |
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
| class CodePoint | |
| def initialize(b) | |
| @b = b | |
| end | |
| def hex | |
| @b.to_s(16) | |
| end | |
| def char_windows |
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
| git status --porcelain | grep 'test' | grep -v 'factories' | cut -c4- | sort | uniq | xargs zeus test |
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
| diff --git a/app/account.rb b/app/account.rb | |
| index a108685..c89ad34 100644 | |
| --- a/app/account.rb | |
| +++ b/app/account.rb | |
| @@ -1,4 +1,22 @@ | |
| +require 'open-uri' | |
| + | |
| module Sol | |
| + class Url | |
| + def self.get(url) |