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 'json' | |
require 'open-uri' | |
hostname = 'irc' | |
posts = [] | |
page = 1 | |
pages = 1 | |
per_page = 20 | |
begin |
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 'open-uri' | |
require 'nokogiri' | |
require 'yaml' | |
def aggressive_strip text | |
text.strip.gsub(/[\s\r\n]+/, ' ') | |
end | |
postal_code = 10003 | |
url = "http://checkout.spirithalloween.com/storelocation.aspx?zipPostalCode=#{ postal_code }" |
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
FOLKS = %w( | |
Caroline | |
Chris | |
Dave | |
Devin | |
Hindi | |
John | |
Kai | |
Nizar | |
Pat |
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
namespace :gem do | |
task publish: [:commit, :build, :fury] | |
task :commit do | |
current_branch = %x(git rev-parse --abbrev-ref HEAD).strip | |
git_status = %x(git status --short --untracked-files=no) | |
unless current_branch == 'master' | |
puts 'Only run this task with master checked out!' | |
return |
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
/* * * | |
A simple bit of code that automatically prepends an AudioPlayer instance | |
(http://wpaudioplayer.com) before the paragraph of any link to an MP3. | |
Depends on jQuery and AudioPlayer. | |
* * */ | |
$(function() { |
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
# tl;dr | |
# grabs some tumblr posts from google and returns their word lengths! | |
# for nostrich! | |
require 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'json' | |
lengths = [] |
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
# title_is_summary - does this RSS item REALLY have a title? | |
# see: tumblr photo posts | |
# | |
# title = (title of some RSS item) | |
# description = (description of the same item) | |
clean_title = title.strip.gsub(/\s+/, ' ').sub(/\.\.\.$/, '') | |
clean_description = description.gsub(/(<|<).+?(>|>)/, '').strip.gsub(/\s+/, ' ') | |
title_is_summary = clean_title == clean_description[0 .. clean_title.size - 1] |
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
# That apartment is nice but it's outside your "40 x rent" limit. | |
# How much more are you gonna have to pay? | |
# NOTE: I Am Not A Broker, I'm only *pretty* sure this is how it works, | |
# calculate at your own risk. | |
def security(rent, salary) | |
normal_security = rent * 2 | |
base_rent = salary / 40.0 | |
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
<!-- | |
a styled php version you can throw up on your apache | |
because i'm some kind of machinist | |
--> | |
<style> | |
/* oooh */ | |
html, body, ul, li { font-family: Verdana; font-size: 14px; line-height: 20px; } | |
body { width: 400px; margin: 20px auto; background: #333; } | |
ul { list-style: none; } | |
li { margin-bottom: 10px; color: #AAA; overflow: hidden; height: 20px; white-space: nowrap; text-overflow: ellipsis; } |
OlderNewer