Skip to content

Instantly share code, notes, and snippets.

@youpy
youpy / facebook_chat_logger.rb
Created September 29, 2011 04:28
facebook chat logger
# OSX only
%w/ubygems grope pit open-uri/.each {|g| require g }
def main
url = 'http://www.facebook.com/'
env = Grope::Env.new
env.load(url)
if env.document.title !~ /^Facebook/
// ==UserScript==
// @name Facebook.com: notify changes of online friends
// @namespace http://buycheapviagraonlinenow.com/
// @include http://www.facebook.com/
// ==/UserScript==
var notifyServerUrl = 'http://localhost:5678/', // https://gist.github.com/1021283
current, previous = [];
setInterval(function() {
http://itpro.nikkeibp.co.jp/word/
http://ceron.jp/
http://tweetbuzz.jp/
http://wadaino.jp/
http://eimg.jp/
http://d.hatena.ne.jp/keyword/
http://clip.livedoor.com/site/
http://b.hatena.ne.jp/entry/
http://friendfeed.com/
http://e-words.jp/
# OSX only
#
# curl https://raw.github.com/gist/1234626/OptimizeGoogle%20BlockDomain | ruby add_blocked_sites.rb
%w/ubygems grope pit/.each {|g| require g }
config = Pit.get("google.com", :require => {
'username' => 'your username in google',
'password' => 'your password in google'
})
ruby -rubygems -e "require 'rb-skypemac';s=[:online,:away,:dnd,:invisible,:na];i=0;loop {SkypeMac::Iam.send(s[i%s.length]);i+=1;sleep 0.2}"
// ==UserScript==
// @name Google Latitude: Notify Location
// @namespace http://buycheapviagraonlinenow.com/
// @include https://www.google.com/latitude/*
// ==/UserScript==
var notifyServerUrl = 'http://localhost:5678/', // https://gist.github.com/1021283
location = {}, lastLocation = {};
setInterval(function() {
thanks for your submission!
your confirmation number is ######872011
keep it in a safe place!
# ruby ttf_glitch.rb target.ttf > glitched.ttf
def main
filename = ARGV.shift
open(filename, 'rb') do |f|
content = f.read
offset = glyph_offset(content)
length = glyph_length(content)
@youpy
youpy / scrobbler.rb
Last active September 26, 2015 20:38
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#
# for OSX only
#
# $ gem install launch-agent
# $ launchagent --daemon --env "RBENV_VERSION=2.0.0-p0" -- zsh -c "ruby /path/to/scrobbler.rb"
require 'rubygems'
require 'lastfm'
#!/usr/bin/env ruby
%w/rubygems launch_agent/.each {|g| require g }
def usage
print <<EOM
usage: #{$0} command [arg ...]
EOM
exit 1
end