Skip to content

Instantly share code, notes, and snippets.

View morygonzalez's full-sized avatar
🌴
I may be slow to respond.

Hitoshi Nakashima morygonzalez

🌴
I may be slow to respond.
View GitHub Profile
#!/usr/bin/env ruby
# coding: utf-8
require 'net/http'
require 'uri'
require 'rubygems'
require 'json'
USERNAME = 'morygonzalez'
puts 'input password:'
#!/usr/bin/env ruby
require 'net/http'
require 'cgi'
require 'rubygems'
require 'hpricot'
class Proxy
def initialize
@url = nil
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;
@morygonzalez
morygonzalez / app-apt-repository
Created January 20, 2011 08:46
app-apt-repositoryを使うには、 "python-software-prooerties" が必要
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
@morygonzalez
morygonzalez / fizzbuzz.rb
Created March 21, 2011 15:43
TDD Boot Camp 福岡
#-*- coding: utf-8 -*-
class FizzBuzz
def fizzbuzz(num)
return "FizzBuzz" if num % 15 == 0
return "Buzz" if num % 5 == 0
return "Fizz" if num % 3 == 0
num.to_s
end
@morygonzalez
morygonzalez / cleanup.rb
Created April 5, 2011 08:53
directory clean up (stub)
dir = Dir::entries(Dir::pwd)
dir.each do |d|
unless /^\./ =~ d
f = File::stat(d)
p [d, f.size, f.uid, f.gid, f.atime, f.mtime, f.ftype]
end
end
require "fileutils"
dir = Dir::entries(Dir::pwd)
dir.each do |d|
unless /(^\.|#{__FILE__})/ =~ d
f = File::stat(d)
puts "#{d} is #{(Time.now - f.mtime).div(24*60*60)} days old."
puts "Would you like to remove this file/directory? (y/n)"
answer = gets.chomp
if answer == "y"
perl -pe 's/.+;//' ~/.zsh_history | awk 'BEGIN {FS="|"} {print $1}' | sort | uniq -c | sort -nr | head -10
#!/usr/bin/env ruby
#-*- coding: utf-8 -*-
require "rubygems" if RUBY_VERSION < '1.9'
require "json"
require "oauth/cli/twitter"
access_token = OAuth::CLI::Twitter.get_access_token(:file => ENV['HOME'] + '/.favoritter')
def twitter_ary(statuses)

理想の会社

  1. Gitでソースコード管理している。
  2. 会社のGithubアカウントがある。
  3. 外部に公開されている技術ブログがある。
  4. IDEよりVimやEmacsを使うことが奨励されている。
  5. 社員が勉強会に参加することを奨励している。
  6. オープンソースコミュニティに貢献している。
  7. 音楽を聞きながら仕事できる。
  8. Rubyで開発できる。