View rt_rt_filter.rb
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 'utf8-cleaner' | |
Earthquake.init do | |
output_filter do |item| | |
next if item.nil? || item["text"].nil? | |
str = UTF8Cleaner::URIString.new(item["text"]).cleaned | |
!(/^.+[¥"QR]T(?:[:\s]*@[A-Za-z0-9_]|\(via[:\s]*@[A-Za-z0-9_]).+[¥"QR]T/ =~ str) | |
end | |
end |
View asahibyun.rb
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 -*- | |
# superdry tweet / earthquake plugin | |
# | |
# superdry: http://shindanmaker.com/43570 | |
# | |
require 'net/http' | |
require 'nokogiri' | |
Earthquake.init do | |
command :byunasahi do |
View collaborative_tweet_filter.rb
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
Earthquake.init do | |
output_filter do |item| | |
next if item.nil? || item["text"].nil? | |
!(/collaborative tweet/ =~ item["source"]) | |
end | |
end |
View export_to_day_one.rb
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 ruby | |
require 'csv' | |
require 'active_support/all' | |
require 'rb-dayone' | |
class DiaryFromDayOne | |
attr_reader :target_date, :title, :content, :created_at | |
def initialize(row) |
View gist:0b9d911a001d0c8c94e8
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
thread_started_at = Time.now | |
thread_finished_at = nil | |
for i in 1..4 do | |
Thread.start(i) do |t| | |
puts "started thread #{t}" | |
sleep 1 | |
puts "finished thread #{t}" | |
thread_finished_at = Time.now if t == 4 | |
end | |
end |
View gist:d70244c7139953386ab6
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
Failures: | |
1) cleanup_users unconfirmed_users should change result | |
Failure/Error: expect { @rake['cleanup_users:unconfirmed_users'].invoke }.to \ | |
NameError: | |
undefined local variable or method `touch_paranoia_column' for #<Design:0x007fb7330ddc38> | |
# ./lib/tasks/cleanup_users.rake:38:in `block (3 levels) in <top (required)>' | |
# ./lib/tasks/cleanup_users.rake:35:in `block (2 levels) in <top (required)>' | |
# ./spec/lib/tasks/cleanup_users_spec.rb:31:in `block (4 levels) in <top (required)>' | |
# ./spec/lib/tasks/cleanup_users_spec.rb:31:in `block (3 levels) in <top (required)>' |
View gist:407131
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 ruby | |
# coding: utf-8 | |
require 'net/http' | |
require 'uri' | |
require 'rubygems' | |
require 'json' | |
USERNAME = 'morygonzalez' | |
puts 'input password:' |
View gist:476679
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 ruby | |
require 'net/http' | |
require 'cgi' | |
require 'rubygems' | |
require 'hpricot' | |
class Proxy | |
def initialize | |
@url = nil |
View 21_Pinboard.js
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
if(typeof(models)=='undefined') | |
this.models = models = new Repository(); | |
var Pinboard = { | |
name : 'Pinboard', | |
ICON : 'http://pinboard.in/favicon.ico', | |
getCurrentUser : function() { | |
if(decodeURIComponent(getCookieString('pinboard.in', 'login')).match(/login=(.*?) /)) | |
return RegExp.$1; |
View app-apt-repository
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
Re: add-apt-repository not working? not installed? | |
"sudo add-apt-repository ppa:<repository name>" this registers the ppa with APT and an entry is created in /etc/apt/sources.list and backs up to /etc/apt/sources.list.save. ff a key is required and available it is automatically downloaded and registered. | |
you must have "python-software-properties" installed before using this command |
OlderNewer