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 canonical-link | |
// @namespace http://www.hatena.ne.jp/hitode909 | |
// @include * | |
// ==/UserScript== | |
(function() { | |
if (window != window.parent) { | |
return; | |
} |
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
# replace HERE interactive, execute command. | |
# for example: ruby interactive.rb expr HERE + HERE + HERE | |
require 'readline' | |
require 'shellwords' | |
HERE = /HERE/ | |
def read_input | |
Readline.readline("> ", true) |
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
# git ls-files | ruby theseus.rb | sort | uniq -c | |
require 'time' | |
ARGF.each_line.each_with_index {|file, index| | |
blame = `git blame -c #{file}`.encode('utf-8', invalid: :replace, undef: :replace, replace: '').split(/\n/) | |
blame.each{|line| | |
puts Time.parse(line.split(/\t/)[2]).year | |
} | |
} |
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
{"created_at"=>"Sat May 22 10:49:45 +0000 2010", "target_object"=>{"coordinates"=>nil, "truncated"=>false, "favorited"=>false, "created_at"=>"Sat May 22 10:49:12 +0000 2010", "text"=>"おなすい!", "contributors"=>nil, "id"=>14487053754, "geo"=>nil, "in_reply_to_user_id"=>nil, "user"=>{"profile_sidebar_border_color"=>"C0DEED", "name"=>"sekineyuco", "profile_background_tile"=>true, "profile_sidebar_fill_color"=>"DDEEF6", "location"=>"橋本", "created_at"=>"Mon Aug 03 05:45:29 +0000 2009", "profile_image_url"=>"http://a3.twimg.com/profile_images/820505233/______normal.jpg", "profile_link_color"=>"0084B4", "contributors_enabled"=>false, "favourites_count"=>1416, "url"=>"http://corinyou.blogspot.com/", "utc_offset"=>32400, "id"=>62447967, "protected"=>false, "followers_count"=>217, "profile_text_color"=>"333333", "lang"=>"ja", "notifications"=>false, "time_zone"=>"Tokyo", "verified"=>false, "profile_background_color"=>"C0DEED", "description"=>"多摩美術大学グラフィックデザイン学科3年生", "geo_enabled"=>false, "statuses_count"=>5943, "friends_ |
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
(defun prt-introduce-variables () | |
(interactive) | |
(if mark-active | |
(let ( | |
(resultbuf (get-buffer-create "*introduce-variables*")) | |
) | |
(with-current-buffer resultbuf | |
(setq buffer-read-only nil) | |
(erase-buffer) | |
) |
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
use strict; | |
use warnings; | |
use URI; | |
use DateTime; | |
use Test::More; | |
package Immutable { | |
sub new { | |
my ($class, $obj) = @_; | |
bless { |
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
gem "urls", git: "https://gist.github.com/8e3fde72960e9adbbc7b5cbf4e0d5861.git" |
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 'uri' | |
while line = gets | |
begin | |
URI.extract(line, ['http', 'https']).each do |uri| | |
puts uri | |
end | |
rescue | |
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
# -*- coding: utf-8 -*- | |
require 'nokogiri' | |
require 'open-uri' | |
require 'icalendar' | |
# 立命館大学の学年暦(学部)からiCal形式のカレンダーを生成 | |
# 使い方 ruby rits_gakubu_ial.rb > gakubu.ics | |
calendar = Icalendar::Calendar.new | |
source_url = 'http://www.ritsumei.jp/profile/a11_j.html' |
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
# Description: | |
# LGTM | |
# | |
# Commands: | |
# hubot LGTM - LGTM | |
# hubot lgtm register <URL> - register a new LGTM | |
BRAIN_KEY = 'lgtm' | |
module.exports = (robot) -> |