Skip to content

Instantly share code, notes, and snippets.

View hanachin's full-sized avatar
🌺
OKA

Seiei Miyagi hanachin

🌺
OKA
View GitHub Profile
require 'with_refinements'
module Ext
refine Integer do
def asdjflk
"ujihisa #{self}"
end
end
end
@hanachin
hanachin / post_actions_controller.rb
Last active March 18, 2016 15:15 — forked from sinsoku/action.rb
action resource
# app/controllers/post_actions_controller.rb
class PostActionsController < ApplicationController
# POST /posts/:id/publish.json
def publish
if current_post.update(state: :publish, published_at: Time.zone.now)
else
end
end
puts 'gist gem'
class PatternConverter
def initialize(pattern, &convert)
@pattern = pattern
@convert = convert
end
def ===(s)
@pattern === s
end
class SocketServerClass
_sioListenPort = 8080
constructor : (@app, @nodeModules, @appOption) ->
@sio = @nodeModules.sio
@http = @nodeModules.http
@appServer = @http.createServer(@app)
# session --------------------
@mongoose = require 'mongoose'
@hanachin
hanachin / ask_hand_service.rb
Last active December 19, 2015 11:39 — forked from webcrafts/gist:5948862
janken game. $ ruby main.rb
require './hand.rb'
class AskHandService
CHOICE_NUMBER_START = 1
def initialize
@hands = Hand.rock_paper_scissors
end
def choices
#!/bin/sh
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
@hanachin
hanachin / data.yml
Last active December 14, 2015 03:08 — forked from kimihito/data.yml
Lisa_Rose:
Lady_in_the_Water: 2.5
Snakes_on_a_Plane : 3.5
Just_My_Luck: 3.0
Superman_Returns: 3.5
You_Me_and_Dupree: 2.5
The_Night_Litener: 3.0
Gene_Seymour:
Lady_in_the_Water: 3.0
@hanachin
hanachin / pomodoro.rb
Created October 10, 2012 17:36 — forked from kimihito/pomodoro.rb
ボク用ポモドーロbot
#!/usr/bin/env ruby
#-*- coding: utf-8 -*-
require 'twitter'
require 'user_stream'
require 'active_support'
require 'active_support/core_ext'
require 'enumerable/lazy'
UserStream.configure do |config|
config.consumer_key = 'YOUR COMSUMER KEY'
@hanachin
hanachin / README.md
Created September 14, 2012 01:46 — forked from tompng/gist:3719273
youtube gen playlist