Skip to content

Instantly share code, notes, and snippets.

View tobynet's full-sized avatar

tobynet tobynet

  • Toyama, Japan
View GitHub Profile
@raggi
raggi / validate_local_cache.sh
Last active December 11, 2015 23:39
A script to validate your local gem cache against the public s3 repositories. If you find mismatches that contain both local and remote values, please post them in comments.
#!/usr/bin/env sh
if ! which md5sum > /dev/null; then
echo Install md5sum
exit 1
fi
if ! which curl > /dev/null; then
echo Install curl
exit 1
@robotslave
robotslave / gist:4633393
Last active March 31, 2025 20:02
How to get Emoji in your Ubuntu Terminal
<!--
1. Download the Android Jelly Bean fonts and the Symbola font:
https://www.dropbox.com/s/tvtzcnzkvbe0nrt/jelly-bean-fonts.zip
http://users.teilar.gr/~g1951d/Symbola707.zip
2. unzip the files and put AndroidEmoji.ttf and Symbola.ttf (and any of the other fonts that strike your fancy)
in your ~/.fonts/ directory
3. run `fc-cache -f`. You can check to make sure the new fonts
were installed with `fc-list`. You'll probably want to grep the copious output for Symbola or Emoji
#!/usr/bin/env ruby
Dir.glob("#{ENV['HOME']}/works/**").each do |dir|
next unless File.exists?("#{File.expand_path(File.join(dir, '.git'))}")
Dir.chdir(dir) do
system("nippo.rb")
end
end
@todesking
todesking / cap_task_server_list.rb
Created January 10, 2013 10:54
cap、定義されてるサーバ一覧表示するタスク
task :server_list do
roles.each do|name, role|
role.each do|server|
puts "%10s %13s %s" % [name, server, server.options.inspect]
end
end
end
@fuba
fuba / shiritori.pl
Created January 2, 2013 16:24
しりとり
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Encode;
use YAML::Syck;
use TokyoCabinet;
use Text::KyTea;
use Unicode::Japanese;
// ==UserScript==
// @name delete kindle item
// @namespace [email protected]
// @include https://www.amazon.com/gp/digital/fiona/manage*
// @include https://www.amazon.co.jp/gp/digital/fiona/manage*
// @version 1
// ==/UserScript==
jQuery('<button id="delete_all_item" style="margin-left:10px;">delete all</button>').insertAfter('#searchTextGoButton');
@ybenjo
ybenjo / ikoma.rb
Created November 30, 2012 13:56
生駒日記取得
# usage: ruby ikoma.rb | pbcopy
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open("http://d.hatena.ne.jp/mamoruk/archive?word=&of=#{rand(1550)}", :proxy => nil).read)
entries = (doc/'li.archive.archive-section'/'a'); elem = entries[rand(entries.size)]
puts "#{elem.inner_text} #{elem.attribute('href').value}"
@youpy
youpy / consolidate_repos.rb
Created November 30, 2012 05:57
consolidate two git repos
#!/usr/bin/env ruby
# -*- coding: utf-8; ruby -*-
# http://d.hatena.ne.jp/okinaka/20111010/1318211550
require 'shellwords'
def main
old = File.expand_path(ARGV[0])
new = File.expand_path(ARGV[1])
branch_name = Time.now.to_i.to_s
function! s:search(name)
return map(filter(webapi#json#decode(webapi#http#get(printf('https://api.github.com/legacy/repos/search/%s', a:name)).content).repositories, 'v:val.name==a:name'), 'v:val.username ."/". v:val.name')
endfunction
echo s:search('gist-vim')
@teppeis
teppeis / tenkaichi-git.md
Last active April 29, 2023 14:58
天下一gitconfig大会

天下一gitconfig大会(サイボウズ社内git勉強会@2012/11/20)の@teppeisの資料です。

ぎっとぎとにしてやんよ

DojoCat

  • gistでmarkdown書いたらbookmarkletでプレゼンになるよ。