Skip to content

Instantly share code, notes, and snippets.

View oieioi's full-sized avatar
๐Ÿ™
๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™

oieioi

๐Ÿ™
๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™
View GitHub Profile
class U
@@attr = [
:id,
:name
]
attr_accessor(*@@attr)
def initialize(values)
@@attr.each {|key|
self.send("#{key}=".to_sym, values[key])
@oieioi
oieioi / notify-github-pull-request.coffee
Last active March 2, 2018 02:44
hubot script to notify github pull requests
# Description:
# ใƒ—ใƒซใƒชใ‚ฏใŠ็Ÿฅใ‚‰ใ›
#
# Configuration:
# GITHUB_TOKEN
# REPO_OWNER
# REPO_NAME
# DEVELOPER_ROOM_NAME
#
# Dependencies:
@oieioi
oieioi / sokutei.rb
Last active December 13, 2017 10:36
DOMContentLoaded ใจ load ใ‚คใƒ™ใƒณใƒˆ็ถ™็ถšใ™ใ‚‹ ruby ใ‚นใ‚ฏใƒชใƒ—ใƒˆ
require "selenium-webdriver"
DELIMITER = ','
print "target URI: "
target = STDIN.gets.strip
print "count: "
count = STDIN.gets.strip.to_i
print "smart phone? (y/n): "
@oieioi
oieioi / github-milestone-2-md.js
Last active February 19, 2018 06:00
GitHub MileStone issues 2 markdown. GitHubใฎใƒžใ‚คใƒซใ‚นใƒˆใƒผใƒณใƒšใƒผใ‚ธใฎใ‚คใ‚ทใƒฅใƒผไธ€่ฆงใ‚’ใƒžใƒผใ‚ฏใƒ€ใ‚ฆใƒณใซใ™ใ‚‹
(function(){
let prefix = prompt('prefix?');
alert([].map.call(
document.querySelectorAll('.js-draggable-issues-container > li a.js-navigation-open'),
e => `${prefix} #${e.href.split('/')[6]} ${e.textContent.trim()}`)
.join('\n'))
})()
@oieioi
oieioi / Dockerfile
Created February 11, 2018 09:51
.htaccess ใƒ†ใ‚นใƒˆ็”จใฎใฉใฃใ‹ใƒผ
FROM httpd
COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf
@oieioi
oieioi / github-milestone-issues-2-markdown.user.js
Last active February 19, 2018 06:50
Convert issues in github milestone page to plain text list with prefix (such as `-` and `###`)
// ==UserScript==
// @name issues2md
// @namespace http://tampermonkey.net/
// @version 0.1
// @description issues in github milestone detail page to list
// @author oieioi
// @match https://github.com/*/*/milestone/*
// @grant none
// ==/UserScript==
@oieioi
oieioi / notify-github-mentioned.coffee
Last active March 1, 2018 12:57
hubot script to notify github mentioned
# Description:
# GitHub ใฎใƒกใƒณใ‚ทใƒงใƒณใŠ็Ÿฅใ‚‰ใ›
#
# Configuration:
# GITHUB_TOKEN
# REPO_PATHS "owner_name/repo_name_1,owner_name/repo_name_2,other_owner_name/repo_name_3"
# DEVELOPER_ROOM_NAME
#
# Dependencies:
# "@octokit/rest": "^14.0.9"
@oieioi
oieioi / github-issue-templatize.user.js
Last active March 6, 2018 14:34
GitHub ใฎ issue ไฝœๆˆ็”ป้ขใฎใƒ†ใƒณใƒ—ใƒฌใƒผใƒˆใ‚’ไฝœใ‚‹
// ==UserScript==
// @name GitHub issue templatize
// @namespace http://tampermonkey.net/
// @version 0.2
// @description GitHub issue templatize
// @author oieioi
// @match https://github.com/*/*/issues/new*
// @grant none
// ==/UserScript==
(function() {
@oieioi
oieioi / forwardable_class.rb
Last active July 11, 2018 06:33
forwardable ใง delegate ใ™ใ‚‹
require 'forwardable'
class Hoge
include Enumerable
extend Forwardable
def_delegators :@hash, :each, :reject!
def initialize hash
@hash = hash
end
@oieioi
oieioi / average_columns.rb
Last active August 1, 2018 05:30
็ฉบ็™ฝๅŒบๅˆ‡ใฎๆ•ฐๅญ—ใƒ‡ใƒผใ‚ฟใƒ†ใƒผใƒ–ใƒซใฎๅนณๅ‡ๅ€คใ‚’ๅ‡บๅŠ›ใ™ใ‚‹
require 'pp'
# USAGE:
# $ cat << EOS| ruby average_columns.rb
# 123 123 123
# 333 333 333
# 444 34 23
# 43 3 33
# EOS
PRECISION = (ENV['PRECISION'] || 1).to_i
DELIMINATOR = ENV['DELIMINATOR'] || ' '