Skip to content

Instantly share code, notes, and snippets.

@sorah
sorah / lastfm_fluentd.rb
Created February 6, 2015 08:08
lastfm to fluentd
require 'fluent-logger'
require 'open-uri'
require 'nokogiri'
user = ENV['LF_USER']
marker = ENV['LF_MARKER'] || File.expand_path('~/.lastfm_fluentd.mark')
last = if File.exist?(marker)
File.read(marker).chomp
else
nil
@saboyutaka
saboyutaka / booth_link.coffee
Created April 16, 2014 11:22
booth_link.coffee
@saboyutaka
saboyutaka / idobata_debug.coffee
Created April 16, 2014 11:20
idobata_debug.coffee
util = require 'util'
module.exports = (robot) ->
robot.respond /debug( snippet)?/, (msg) ->
if msg.match[1]?
msg.send '```\n' + util.inspect(msg) + '\n```'
else
msg.send util.inspect msg
@lestrrat
lestrrat / gist:9104980
Last active August 3, 2017 21:55
ヘビメタ英語を日常で使う風景
before_filter :g_action
def g_action
g "#{self.class.name}##{action_name}"
end
javascript:(function(){var e=window.open(null,null,"width=480,height=300,menubar=no,toolbar=no,location=no,status=no,resizable=noscrollbars=no"),t=document.createElement("img"),n=[39,53,29,41,14,20],r=function(){var e=Math.ceil(Math.random()*6),s=Math.ceil(Math.random()*n[e-1]);t.setAttribute("src","http://mogashi.no-ip.org/alice/?ep="+e.toString()+"&no="+s.toString());setTimeout(r,1e4)};t.style.margin="0";e.document.body.style.margin="0";e.document.body.style.padding="0";e.document.body.appendChild(t);r()})()
require 'date'
require 'i18n'
JAVA = "http://www.java.com/#{I18n.locale}/"
YOU = `whoami`
def DOWNLOAD(today)
puts "Free Java Download"
puts JAVA
@june29
june29 / tashitari-kaketari.coffee
Created June 3, 2013 02:46
callbackを使って協調的に動作するクラスの例を示すためのコード
class TasuHito
constructor: (base) ->
@base = base
@tashitaAto = null
tasu: (number) =>
result = number + @base
console.log result
setTimeout =>
@sorah
sorah / 0.mkd
Last active December 17, 2015 06:59

録画の話

ハードウェア構成

  • HP ProLiant MicroServer http://h50146.www5.hp.com/products/servers/proliant/micro/

    • ちっこいやつ。18000 円くらいで手に入る。低消費電力だけど CPU が Atom 相当なのでそれなりに遅い。
  • CPU model name: AMD Turion(tm) II Neo N40L Dual-Core Processor

  • CPU MHz: 800.000

Using rails_admin without devise

Having a buckload of code to authorize users on your application is something you may like or not. Speaking for myself I hate it. But I still love rails_admin, here's how you install it without devise. Thanks to phoet for providing the hints in the gist I have forked from.

Add RailsAdmin to your Gemfile

do NOT add devise

gem "rails_admin", :git => "git://github.com/sferik/rails_admin.git"