Skip to content

Instantly share code, notes, and snippets.

View rummelonp's full-sized avatar
🐈‍⬛
ニャーン

Kazuya Takeshima rummelonp

🐈‍⬛
ニャーン
View GitHub Profile
@hotchpotch
hotchpotch / cocproxy.nginx.conf
Created May 25, 2011 04:50
cocproxy for nginx
#!nginx -p . -c cocproxy.nginx.conf
error_log /dev/stderr debug;
daemon off;
events {
worker_connections 48;
}
http {
@yuroyoro
yuroyoro / Home2Lang.scala
Created June 1, 2011 06:05
プログラミング言語「ほむほむ」
import java.io.File
import scala.io.Source
import scala.util.matching.Regex
import scala.util.parsing.combinator._
import scala.util.parsing.input.{Position, NoPosition}
sealed abstract class Insn extends ( CED => CED ){
val pos:Position
}
case class App( m:Int, n:Int, pos:Position ) extends Insn{
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
@kkosuge
kkosuge / twitter_profile_transparent.js
Created June 26, 2011 06:17
twitterのサイドバーとか透明に設定させるやつ
// https://twitter.com/settings/design でブラウザのURL入ってるとこに入れて保存する
// サイドバーと背景は透明になるけど流石にfontは消えなかった。transparentとか指定しても弾かれる
javascript:d=document;d.getElementById("user_profile_sidebar_fill_color").value = '';d.getElementById("user_profile_sidebar_border_color").value = '';d.getElementById("user_profile_text_color").value = '';d.getElementById("user_profile_background_color").value = '';d.getElementById("user_profile_link_color").value = '';void(0);
//chromeのURLバーに入れてもjavascript実行できなくなった。
//ブックマークレットにして使った方がよさそう。
javascript:d=document;d.getElementById("user_profile_sidebar_fill_color").value = '';d.getElementById("user_profile_sidebar_border_color").value = '';void(0);
@yuya-takeyama
yuya-takeyama / marker_spec_01.rb
Created June 26, 2011 18:40
RSpec の書き方, メソッド単位に describe で分割するパターンと, オブジェクトの状態単位に context で分割するパターンとあると思う.
# メソッド単位に describe で分割するパターン
require 'spec_helper'
module Codebreaker
describe Marker do
let(:secret) { '1234' }
describe '#exact_match_count' do
subject { Marker.new(secret, guess).exact_match_count }
@syoichi
syoichi / a_smart_dashboard_have_my_id.user.js
Created July 7, 2011 04:43 — forked from rummelonp/a_smart_dashboard_have_my_id.user.js
自分のIDやページのURLがDashboardなどから取得できない時でも部分的に動作するように修正した。また、Likeなどのページでも動作するように変更した。
// ==UserScript==
// @id A smart dashboard have my id
// @name A smart dashboard have my id
// @namespace http://mitukiii.jp/
// @author mitukiii
// @version 0.0.3
// @update 2012-02-16T03:26:28.351Z(GMT+09:00)
// @description TumblrのDashboardで自分からReblogされた/自分のidを含んだpostを折り畳むスクリプト
// @include http://www.tumblr.com/dashboard*
// @include http://www.tumblr.com/show/*
@wtnabe
wtnabe / to_php.rb
Created July 8, 2011 05:07
Translate from your Ruby object to PHP literal
class Object
def to_php
self.inspect.gsub( /[\[{]/, 'array(' ).gsub( /[}\]]/, ')' )
end
end
@kkosuge
kkosuge / favter.rb
Created July 23, 2011 09:51
favorit爆撃を与えてターゲットのデスクトップをGrowlで埋めるなどします
#coding: utf-8
require 'twitter'
Twitter.configure do |config|
config.consumer_key = YOUR_CONSUMER_KEY
config.consumer_secret = YOUR_CONSUMER_SECRET
config.oauth_token = YOUR_OAUTH_TOKEN
config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
end
@kkosuge
kkosuge / glitch_tweet.rb
Created August 8, 2011 16:01
よく使うのでメモ
ary=gets.chomp.split('');tweet=[];140.times{tweet<<ary[rand(ary.size)]};p(tweet.join)
#=> ruby glitch_tweet.rb
#=> もう何も恐くない
#=> "何いな何もくうなういう何いくく恐うもなももも何ななもううもももも恐恐何く何くいもくももう何恐なく何いなな何ななもううも恐うくももくもうもうい何何何もくな恐何何もな何いくいいう何なもういもいくうく恐いいくも何くいい何うもももくなうくくもくなもなううないなくももなく恐くう恐いも何くい"
@mizchi
mizchi / nodejq.coffee
Created August 8, 2011 22:48
スクレイピングのひな形
request = require('request')
jsdom = require('jsdom').jsdom;
jquery = require('jquery')
fs = require 'fs'
fetch = (uri,fn)->
request uri:uri, (error, response, body)->
fn error,jquery.create jsdom(body).createWindow()
save = (path)->