Skip to content

Instantly share code, notes, and snippets.

🕊
Happy Hacking

Sho Kusano rosylilly

🕊
Happy Hacking
Block or report user

Report or block rosylilly

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am rosylilly on github.
  • I am rosylilly (https://keybase.io/rosylilly) on keybase.
  • I have a public key ASDXu2zmeAhbqsBCB6g3d2j_xpXno9PUlRSpbqelCQXFyQo

To claim this, I am signing this object:

@rosylilly
rosylilly / myfi.rb
Created Feb 28, 2018
DNS switcher for macOS
View myfi.rb
#!/usr/bin/env ruby
require 'optparse'
require 'pathname'
require 'yaml'
VERSION = '0.0.1'
HOMEDIR = Pathname.new(ENV['HOME'])
options = {
View partial_validator.rb
# frozen_string_literal: true
class PartialValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
return if options[:if] && !valuable(record, options[:if])
return if options[:unless] && valuable(record, options[:unless])
value.validate
value.errors.messages.each_pair do |attr, messages|
messages.each do |message|
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>JS TEST</title>
</head>
<body>
<script type="text/javascript">
(function() {
"use strict";
View guideline.md

crystal-jp/issues's guideline

Issuer の皆さんへ

どんな時に作るのか

こんなことでお困りの時は、お気軽に issue を作っていただければ、何かお力になれるかもしれません。

  • Crystal 本体や Crystal 関連のライブラリに問題を見つけたけど、本家のリポジトリに報告すべきか悩むとき。(bugs ラベルを付ける)
  • Crystal 本体や Crystal 関連のライブラリに要求したい機能があるけど、本家のリポジトリで話し合う前に意見を求めたいとき。(features ラベルを付ける)
View hello-world.cr
puts "Hello, World"
STDOUT.puts "Hello, World"
class Point
property :x, :y
def initialize(@x, @y)
end
end
@rosylilly
rosylilly / dci.go
Last active Aug 29, 2015
これ DCI なんでは?
View dci.go
package main
import (
"fmt"
)
type User struct {
Name string
}
@rosylilly
rosylilly / refinements.rb
Created Jan 5, 2014
refinements w/ block
View refinements.rb
class A
def say
puts "A"
end
end
module B
def self.role(klass, &block)
ref = refine(klass) { }
ref.module_eval(&block)
@rosylilly
rosylilly / 00-actor.rb
Last active Mar 3, 2017
分かった気になる DCI 、ロミオとジュリエット編 Romeo & Juliette with DCI
View 00-actor.rb
# 役者クラス
#
# say: 役者は声を発する事ができる。
class Actor
def say(words)
puts words
end
end
@rosylilly
rosylilly / gist:8013662
Last active Dec 31, 2015
ask.fm への解答
View gist:8013662
require 'unextend'
class Person
attr_accessor :husbund, :wife
def help(other)
...
end
def tell_love(other)
You can’t perform that action at this time.