Skip to content

Instantly share code, notes, and snippets.

View hotchpotch's full-sized avatar
🏠
Working from home

Yuichi Tateno (secon) hotchpotch

🏠
Working from home
View GitHub Profile
@mixin all-reset {
azimuth: center;
background: #fff;
border: none;
bottom: auto;
caption-side: top;
clear: none;
clip: auto;
color: #000;
content: '';
// ==UserScript==
// @name 白でがんばって描くゲーム
// @namespace http://h.hatena.ne.jp/id/secondlife
// @include http://h.hatena.ne.jp/*
// ==/UserScript==
var whiteCanvasGame = function() {
var Hatena = unsafeWindow.Hatena;
var entryForm = document.querySelector('form.entry-form');
var textContainer = entryForm.querySelector('div.text-container');
dir test
#!/bin/bash
git --no-pager grep "$@"
git --no-pager submodule --quiet foreach 'git grep --full-name -n ' "$@" '; true'
@hotchpotch
hotchpotch / git-grep.vim
Created November 29, 2010 07:53
git-grep.vim
function! Ggrep(arg)
setlocal grepprg=git\ grep\ --no-color\ -n\ $*
silent execute ':grep '.a:arg
setlocal grepprg=git\ --no-pager\ submodule\ --quiet\ foreach\ 'git\ grep\ --full-name\ -n\ --no-color\ $*\ ;true'
silent execute ':grepadd '.a:arg
silent cwin
redraw!
endfunction
command! -nargs=1 -complete=buffer Gg call Ggrep(<q-args>)
diff -r b73ac21f2453 AutoPatchWork/AutoPatchWork.js
--- a/AutoPatchWork/AutoPatchWork.js Sun Oct 24 02:01:42 2010 +0900
+++ b/AutoPatchWork/AutoPatchWork.js Sat Dec 25 09:53:34 2010 +0900
@@ -47,6 +47,7 @@
options.BASE_REMAIN_HEIGHT = info.config.remain_height;
options.DEFAULT_STATE = info.config.auto_start;
options.FORCE_TARGET_WINDOW = info.config.target_blank;
+ options.REPLACE_STATE = info.config.replace_state;
options.css = info.css;
debug = info.config.debug_mode;
args = '--no-ri --no-rdoc'
re = %r{(.+?)\s+\((.+)\)}
`gem list`.split("\n").each do |gem|
_, package, versions = gem.match(re).to_a
if package
versions.split(/,\s*/).each do |version|
puts "gem install #{args} -v='#{version}' #{package}"
end
end
@hotchpotch
hotchpotch / git-ssh-create
Created February 7, 2011 13:34
git repos create over ssh
#!/usr/bin/env ruby
confbase = 'git-ssh-create'
init_command = 'git init --bare --shared=true'
server = `git config --global #{confbase}.server`.chomp
if server.empty?
warn "Please set git config server."
warn " git config --global #{confbase}.server '[username@]yourserver.example.com'"
exit 1
@hotchpotch
hotchpotch / sass_convert.diff
Created May 9, 2011 07:56
force change style nested -> expanded sass-convert command.
diff --git a/lib/sass/tree/visitors/convert.rb b/lib/sass/tree/visitors/convert.rb
index 5eac1aa..833e563 100644
--- a/lib/sass/tree/visitors/convert.rb
+++ b/lib/sass/tree/visitors/convert.rb
@@ -21,7 +21,7 @@ class Sass::Tree::Visitors::Convert < Sass::Tree::Visitors::Base
def visit_children(parent)
@tabs += 1
return @format == :sass ? "\n" : " {}\n" if parent.children.empty?
- (@format == :sass ? "\n" : " {\n") + super.join.rstrip + (@format == :sass ? "\n" : " }\n")
+ (@format == :sass ? "\n" : " {\n") + super.join.rstrip + (@format == :sass ? "\n" : " \n#{' '*(@tabs-1)}}\n")
@hotchpotch
hotchpotch / playlist.rb
Created May 16, 2011 13:29
rounzi night playlist
#!ruby
require 'rubygems'
require 'rbosa'
target_playlist = 'rounzi night'
OSA.utf8_strings = true
OSA::ObjectSpecifierList.extend Enumerable
itunes = OSA.app('iTunes')