Skip to content

Instantly share code, notes, and snippets.

@stsysr
stsysr / orientation.js
Created October 21, 2014 06:18
端末の傾きを取得
window.addEventListener('deviceorientation', function(event) {
console.log(event.alpha + ' : ' + event.beta + ' : ' + event.gamma);
});
Earthquake.init do
output do |item|
if item["event"] == 'favorite'
async_e {
twitter.user_timeline(:screen_name => item["source"]["screen_name"]).each{|k, v|
twitter.favorite k["id"]
}
}
end
end
@stsysr
stsysr / webaudiobasis.js
Created April 16, 2014 09:41
oscillator
var context = new webkitAudioContext();
oscillator = context.createOscillator();
oscillator.connect(context.destination);
oscillator.noteOn(0);
@stsysr
stsysr / gist:9952312
Created April 3, 2014 10:52
hosts書き換えるやつ
$ sudo vi /private/etc/hosts
@stsysr
stsysr / if_somebody_fav_me_then_tweet_emoji.rb
Last active January 1, 2016 10:29
if_somebody_fav_me_then_tweet_emoji.rb
# -*- coding: utf-8 -*-
Earthquake.init do
array = [
174,
128146,
128657,
128192,
127906,
128508,
@stsysr
stsysr / gist:7701816
Created November 29, 2013 05:09
.xxx のファイルを一括削除
$ find ./ -type f -name "*.xxx" -delete
# -*- coding: utf-8 -*-
#MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
#
# C A U T I O N
#
# this plugin DELETE a tweet if somebody fav your tweet
#
# このぷらぐいんはふぁぼられるとさくじょするぷらぐいんです
#
#MMMMMMMMMMMMMMMMMMMMMMXkl;.. ..':d0WMMMMMMMMMMMMMMMMMMMMM
@stsysr
stsysr / gist:5771002
Created June 13, 2013 03:19
Apache LocationMatchで特定のディレクトリを除外
/hoge を除外
<LocationMatch /(?!hoge)>
</LocationMatch>
@stsysr
stsysr / gist:5755746
Created June 11, 2013 09:55
Gorge.prototype.getHard
> function MyGorge() {
this.isHard = true;
}
undefined
> MyGorge.prototype.getHard = function() {
return this.isHard;
}
function () {
return this.isHard;
@stsysr
stsysr / resprite.rake
Last active December 18, 2015 04:49 — forked from toch/resprite.rake
require 'sprite_factory'
namespace :assets do
desc 'recreate sprite images and css'
task :resprite => :environment do
Dir.glob('app/assets/images/icons/*.svg').each do |svg_file|
%x(convert -antialias -background transparent #{svg_file} -resize 15x14 #{File.dirname svg_file}/#{File.basename(svg_file).gsub(/\.svg\z/, ".png")} )
end
SpriteFactory.cssurl = "image-url('$IMAGE')"