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 'tweetstream' | |
APP_PATH = File.expand_path('../../config/application', __FILE__) | |
require File.expand_path('../../config/boot', __FILE__) | |
require APP_PATH | |
Rails.application.require_environment! | |
TweetStream.configure do |config| | |
config.consumer_key = 'redacted' |
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
prev_cols = 0 | |
loop do | |
cols = `tput cols`.chomp.to_i | |
if prev_cols != cols | |
print "\e[1A\e[2K" | |
puts "="*cols | |
end | |
sleep 0.5 | |
prev_cols = cols |
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
# Show iTunes information in real-time in the terminal | |
def status | |
cmd = "osascript -e 'tell application \"iTunes\" to player state'" | |
`#{cmd}` | |
end | |
def track_name | |
cmd = "osascript -e 'tell application \"iTunes\" to name of current track'" | |
`#{cmd}` |
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 'curses' | |
require 'timeout' | |
include Curses | |
PIECE1 = <<PIECE | |
111100000000 | |
111100000000 | |
111111111111 | |
111111111111 |
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
a = morse.split(/ /) | |
h = { | |
'.-' => 'A', | |
'-.' => 'N', | |
'-...' => 'B', | |
'---' => 'O', | |
'-.-.' => 'C', | |
'.--.' => 'P', | |
'-..' => 'D', | |
'--.-' => 'Q', |
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
<input> |
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
<h4>Click on the box and enter a new keyboard shortcut:</h4> | |
<input id="shortcut-box"><button id="clear-shortcut-box">clear</button> |
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 | |
# refresh_latex | |
# Automagically re-render LaTeX files and open the result in a PDF reader. | |
# Using Skim we can do all of this without losing focus to the editor, | |
# although I provide code to somewhat accomplish this with Preview.app | |
# | |
# As of right now it only works in OS X since it uses the "open" command. | |
# Feel free to port it to any platform you want to | |
# |
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
/* | |
* Userstyle for Gradiance (www.newgradiance.com) | |
* | |
* Goals: | |
* - use a sans-serif font (the author failed at CSS and screwed up font-family) | |
* - make the background color easier on the eyes (white and grey vs. blue and other crap) | |
* - remove annoying blue colors for the sake of consistency | |
*/ | |
body { |
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
11-30 11:48:58.671: W/System.err(672): org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') | |
11-30 11:48:58.671: W/System.err(672): at [Source: org.apache.http.conn.EofSensorInputStream@46009b68; line: 1, column: 2] | |
11-30 11:48:58.694: W/System.err(672): at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1432) | |
11-30 11:48:58.694: W/System.err(672): at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:385) | |
11-30 11:48:58.701: W/System.err(672): at org.codehaus.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:306) | |
11-30 11:48:58.701: W/System.err(672): at org.codehaus.jackson.impl.Utf8StreamParser._handleUnexpectedValue(Utf8StreamParser.java:2084) | |
11-30 11:48:58.701: W/System.err(672): at org.codehaus.jackson.impl.Utf8StreamParser._nextTokenNotInObject(Utf8StreamParser.java:600) | |
11-30 11:48:58.701: W/System.err(6 |
OlderNewer