Skip to content

Instantly share code, notes, and snippets.

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

Kazuya Takeshima rummelonp

🐈‍⬛
ニャーン
View GitHub Profile
@rummelonp
rummelonp / nyan.md
Last active August 29, 2015 13:57
Sunspot でタイムゾーンを考慮して投稿日を表示/投稿日毎に集計して表示

app/models/post.rb

class Post < ActiveRecord::Base
  ...
  searchable do
    time :created_at
  end
  ...
end
@rummelonp
rummelonp / cls
Created February 24, 2014 18:46
yasnippet の ruby の class のやつ
#name : class ... end
#group : definitions
# --
class ${1:`(let ((fn (capitalize (file-name-nondirectory
(file-name-sans-extension
(or (buffer-file-name)
(buffer-name (current-buffer))))))))
(replace-regexp-in-string "_" "" fn))`}
$0
end
@rummelonp
rummelonp / grep.rb
Last active August 29, 2015 13:56
Homebrew で grep 2.18 入れるやつ
require 'formula'
class Grep < Formula
url 'http://ftp.gnu.org/gnu/grep/grep-2.18.tar.xz'
sha1 'fdb12580714966745635da7d9db55060f88db28b'
version '2.18'
depends_on 'pcre'
def install
@rummelonp
rummelonp / chawa.css
Last active October 21, 2015 14:04
チャワをいい感じにするやつ
._message .chatTimeLineMessageInner {
padding: 5px 10px;
}
._message[data-deleted="1"] .chatTimeLineMessageInner {
border: none;
padding: 0 10px ;
}
._message[data-deleted="1"] .messegeDelete {
@rummelonp
rummelonp / gist:9054965
Created February 17, 2014 17:21
仕事のストレス
仕事のストレス
   ↘
  コードを書く
   ↙
コードを書く
   ↘
  コードを書く
   ↙
_人人人人人人人人_
> コードを書く <
@rummelonp
rummelonp / tumblr.html
Created February 16, 2014 18:56
タンブラーのやつ
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{Title}{block:PostTitle} - {PostTitle}{/block:PostTitle}</title>
<meta name="viewport" content="width=790">
<link rel="shortcut icon" href="{Favicon}">
<style>
body {
font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
@rummelonp
rummelonp / hatenablog.css
Last active August 29, 2015 13:56
はてなブログのやつ
/* <system section="theme" selected="alpha2"> */
@import "/css/theme/alpha2/alpha2.css";
/* </system> */
/* <system section="background" selected="fff"> */
body{ background:#fff; }
/* </system> */
#container { width: 920px; }
@rummelonp
rummelonp / rbenv-each.rb
Created February 16, 2014 05:55
homebrew で rbenv-each
require 'formula'
class RbenvEach < Formula
head 'https://github.com/chriseppstein/rbenv-each.git'
depends_on 'rbenv'
def install
prefix.install Dir['*']
end
@rummelonp
rummelonp / sample1.rb
Last active August 29, 2015 13:56
プラギン形式のやつどう書こうみたいな
module ShigotoMachine
class Brain
def initialize(adapter)
@adapter = load_adapter(adapter)
end
def load_adapter(adapter)
klass_name = sub(/\A./) { $&.upcase } # camelize
result = [
"shigoto_machine/adapters/#{adapter}", # bundled adapter
@rummelonp
rummelonp / nyan.rb
Created February 9, 2014 08:20 — forked from Shinpeim/nyan.rb
def try_something
nyan
rescue
wan rescue piyo
end