Skip to content

Instantly share code, notes, and snippets.

@y310
y310 / gist:7499626
Last active December 28, 2015 12:19
{
"title": "My Dashboard",
"services": {
"query": {
"idQueue": [],
"list": {
"0": {
"id": 0,
"color": "#7EB26D",
"query": "title:\"踊ってみた\"",
@y310
y310 / gist:1289270
Created October 15, 2011 08:31
show font-size variation
jQuery.unique(
jQuery.makeArray(
jQuery('*').map(function(){
return parseInt(jQuery(this).css('font-size').slice(0, -2));
})
).sort(function(a, b){
return a < b
})
)
@y310
y310 / example.rb
Created July 24, 2011 23:37
nil guard
require 'nil_guard'
include NilGuard::Helper
foo = Foo.new
# 'foo' may be nil, 'bar' may be nil, 'text' may ...
value = nilg(foo).bar.text.to_s.to_value_or_nil #=> nil or value
// ==UserScript==
// @match http://*/*
// ==/UserScript==
(function() {
var inputs = document.querySelectorAll('input[type=text]');
for(var i = 0; i < inputs.length; i++) {
inputs[i].webkitSpeech = true;
inputs[i].addEventListener('speechchange', changed, false);
inputs[i].addEventListener('webkitspeechchange', changed, false);
}