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
def pbcopy(str) | |
IO.popen('pbcopy', 'r+') {|io| io.puts str } | |
output.puts "-- Copy to clipboard --\n#{str}" | |
end | |
Pry.config.commands.command "hiscopy", "History copy to clipboard" do |n| | |
pbcopy _pry_.input_array[n ? n.to_i : -1] | |
end | |
Pry.config.commands.command "copy", "Copy to clipboard" do |str| |
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
{ | |
"title": "Switch IM", | |
"rules": [ | |
{ | |
"description": "right_control -> CN", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "right_control" |
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
#!/bin/bash | |
git --no-pager grep "$@" | |
git --no-pager submodule --quiet foreach 'git grep --full-name -n ' "$@" '; 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
diff --git a/hal/targets.json b/hal/targets.json | |
index 7ce4ad8..3e8969c 100644 | |
--- a/hal/targets.json | |
+++ b/hal/targets.json | |
@@ -1464,16 +1464,18 @@ | |
"macros_add": ["TARGET_RBLAB_NRF51822"] | |
}, | |
"RBLAB_BLENANO": { | |
- "inherits": ["MCU_NRF51_16K"], | |
- "release_versions": ["2"] |
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
BoldAsFont=no | |
CursorType=block | |
Font=Ricty Diminished | |
FontHeight=14 | |
WindowShortcuts=no | |
Transparency=off | |
FontSmoothing=full | |
Term=xterm-256color | |
Locale=ja_JP | |
Charset=UTF-8 |
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 drag & drop fotolife uploader | |
// @namespace http://rails2u.com/* | |
// @description フォトライフでローカルファイルから drag & drop でファイルアップロード (HTML5 File API 対応ブラウザのみ) | |
// @include http://f.hatena.ne.jp/*/up* | |
// ==/UserScript== | |
var upForm = document.getElementById('upload'); | |
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
def glitchnize(image_data) | |
bytes = image_data.bytes | |
length = image_data.length | |
d = Pointer.new(:uchar, length) | |
length.times do |i| | |
c = bytes[i] | |
if c == 42 && rand > 0.8 | |
d[i] = rand(255) | |
else | |
d[i] = c |
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 'formula' | |
class Elasticsearch < Formula | |
homepage 'http://www.elasticsearch.org' | |
url 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.0.Beta1.tar.gz' | |
sha1 'b2c7381368f8df57d10ce5fa18f55876d5d8969d' | |
head 'https://github.com/elasticsearch/elasticsearch.git' | |
depends_on 'maven' if build.head? |
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 'msgpack' | |
require 'pp' | |
while gets | |
line = $_.strip | |
begin | |
pp MessagePack.unpack(line) | |
rescue EOFError => e |
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 'capybara-webkit' # '~> 0.14.0' | |
require 'optparse' | |
require 'cgi' | |
options = {} | |
OptionParser.new do |opt_parser| | |
opt_parser.on('-O filename') {|value| options[:filename] = value } |