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 'tweetstream' | |
require 'open-uri' | |
require 'json' | |
tweetstream = TweetStream::Client.new("user", "pass") | |
tweetstream.track('♫') do |tweet| | |
q = tweet.text.gsub(/[^a-z\s]/i, '') | |
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
// What I'm going after: http://img515.yfrog.com/img515/3872/90335114.png | |
[TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithTopLeft:-1 topRight:-1 bottomRight:-1 bottomLeft:-1] | |
next:[TTSolidFillStyle styleWithColor:[UIColor lightGrayColor] | |
next:[TTBoxStyle styleWithMargin:UIEdgeInsetsZero padding:UIEdgeInsetsMake(0, 8, 0, 8) | |
next:[TTTextStyle styleWithFont:[UIFont boldSystemFontOfSize:15] | |
color:[UIColor whiteColor] | |
minimumFontSize:15 | |
shadowColor:nil | |
shadowOffset:CGSizeZero | |
textAlignment:UITextAlignmentCenter |
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
-- get properties of the playing track | |
tell application "PandoraBoy" | |
set trackArtist to artist of current track | |
set trackName to name of current track | |
end tell | |
-- change the status message to your liking here: | |
set tweet to "♫ " & trackArtist & " - " & trackName | |
-- let the user edit |
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 'nokogiri' | |
require 'open-uri' | |
station_id = 'ea1cf660a072089e6d1a8c963c4de754ce73ab3d53acab5f' | |
songs = [] | |
['track', 'thumb_up'].each do |s| | |
doc = Nokogiri::HTML(open("http://www.pandora.com/favorites/station_tablerows_#{s}.vm?token=#{station_id}")) | |
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 'nokogiri' | |
require 'open-uri' | |
require 'pp' | |
products = [] | |
macs = %w{imac macbook macbook_pro macbook_air mac_mini mac_pro xserve displays mac_accessories} | |
macs.each do |mac| | |
doc = Nokogiri::HTML(open("http://store.apple.com/us/browse/home/specialdeals/mac/#{mac}")) |
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
#import <UIKit/UIKit.h> | |
@interface RoundedCornerTestAppDelegate : NSObject <UIApplicationDelegate> { | |
UIWindow *window_; | |
} | |
@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
require 'rest_client' | |
class GVoice < Struct.new :e, :p | |
def initialize(*args, &block) | |
super; instance_eval &block if block_given? | |
end | |
def send_sms(number, text) | |
post 'sms/send', :phoneNumber => number, :text => text, :_rnr_se => get[/'_rnr_se': '([^']+)'/, 1] | |
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
#ifdef DEBUG | |
#define DLog(...) NSLog(@"%s:%d %s - %@", __FILE__, __LINE__, __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) | |
#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__] | |
#else | |
#define DLog(...) do { } while (0) | |
#ifndef NS_BLOCK_ASSERTIONS | |
#define NS_BLOCK_ASSERTIONS | |
#endif | |
#define ALog(...) NSLog(@"%s:%d %s - %@", __FILE_, __LINE__, __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) | |
#endif |
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
#!/usr/bin/env python | |
import os | |
import sys | |
import getopt | |
import boto | |
from sys import stderr | |
_ec2 = None |
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
[[UIApplication sharedApplication] _performMemoryWarning]; |
OlderNewer