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/ruby | |
# 自分のtweetがふぁぼられたら、即座にコンソールに表示 (with ChirpUserStreams) | |
# by あくあーら ( http://twitter.com/aquarla ) | |
# 参考にしたサイト : | |
# http://d.hatena.ne.jp/shibason/20090816/1250405491 | |
# http://apiwiki.twitter.com/ChirpUserStreams | |
# http://ssig33.com/blog/2010-04-25-1.html | |
require 'net/http' | |
require 'uri' |
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/local/bin/ruby | |
# stalker.rb | |
# 指定したユーザがふぁぼったtweetをリアルタイムで表示 (with ChirpUserStreams) | |
# by あくあーら ( http://twitter.com/aquarla ) | |
# 使い方 | |
# ./stalker.rb [screen_name] | |
require 'net/http' | |
require 'uri' | |
require 'rubygems' |
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
javascript:(function(){var t=new Date();alert(String.fromCharCode(0x32c0+t.getMonth(), 0x33df+t.getDate()))})(); |
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
// ==UserScript== | |
// @name remove now | |
// @namespace la.aquar.greasemonkey | |
// @description 実況封じ | |
// @include http://twitter.com/* | |
// ==/UserScript== | |
var nodes = document.getElementsByTagName('span'); | |
for (var i = 0; i < nodes.length; i++) { | |
if (nodes[i].className == 'entry-content') { |
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
// | |
// PDFView.m | |
// PDFViewerSample | |
// | |
#import "PDFView.h" | |
@implementation PDFView | |
- (id)initWithFrame:(CGRect)frame { |
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' | |
def facebook_like_count(url) | |
open("http://www.facebook.com/plugins/like.php?layout=button_count&show_faces=true&width=120&action=like&colorscheme=light&href=#{url}", | |
"User-Agent" => "Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6") do |html| | |
Nokogiri::HTML.parse(html.read).search("div.connect_widget_button_count_count").text.to_i rescue -1 | |
end | |
end | |
# p facebook_like_count("http://www.yahoo.co.jp/") |
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
$:.push(File.expand_path(File.dirname(__FILE__))) | |
require 'app.rb' | |
run Sinatra::Application |
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
def transaction | |
begin | |
# tx.begin | |
yield | |
# tx.commit | |
rescue | |
# tx.rollback | |
end | |
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
#import <AddressBook/AddressBook.h> | |
//... | |
NSString *title = @""; | |
ABAddressBookRef addressBook = ABAddressBookCreate(); | |
CFArrayRef people = ABAddressBookCopyPeopleWithName(addressBook, CFSTR("ほげほげ")); | |
if (CFArrayGetCount(people) > 0) { | |
ABRecordRef recordRef = (ABRecordRef)CFArrayGetValueAtIndex(people, 0); | |
ABMultiValueRef phones = ABRecordCopyValue(recordRef, kABPersonPhoneProperty); |
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
# -*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'net/https' | |
require 'oauth' | |
require 'json' if RUBY_VERSION < '1.9.0' | |
class DajareBot | |
CONSUMER_KEY = "xxxxxxxx" | |
CONSUMER_SECRET = "xxxxxxxx" |
OlderNewer