Skip to content

Instantly share code, notes, and snippets.

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

oieioi

๐Ÿ™
๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™
View GitHub Profile
@oieioi
oieioi / calc.rb
Last active February 8, 2017 05:01
#! /usr/bin/env ruby
# coding: utf-8
require 'optparse'
def main mode, argv
Calculator.send mode.downcase, argv, parse_options
rescue => e
STDERR.puts "ERROR!"
STDERR.puts e
@oieioi
oieioi / index.coffee
Last active February 6, 2017 03:14
(wip) bookmeter scraper
Nightmare = require 'nightmare'
nightmare = new Nightmare show: true
nightmare
.goto('http://bookmeter.com/u/27559')
.screenshot('test.png')
.end()
.then (result)->
console.log result
.catch (e)->
@oieioi
oieioi / sabun.rb
Created April 7, 2017 00:53
ๆ”น่กŒๅŒบๅˆ‡ใ‚Šใฎๆ•ฐๅˆ—ใฎๅทฎใ‚’ๅ–ๅพ—ใ™ใ‚‹
raw = $stdin.read.split("\n")
moving = raw.
collect {|v|v.to_f}.
instance_eval {
self.collect.with_index {|v, i|
(v - self[i - 1]).round(4) if i - 1 >= 0
}
}#.compact.inject(0) {|v, r| (v - r).round(4)}
puts moving.compact.join "\n"
@oieioi
oieioi / Gemfile
Created May 12, 2017 02:32
ๅŠ่ง’ใ‚ซใƒŠใ‚’ใƒฉใƒณใƒ€ใƒ ใซๅ‡บใ—็ถšใ‘ใ‚‹
source 'https://rubygems.org'
gem 'color_echo'
@oieioi
oieioi / pretty-docs.ruby-lang.org-method-lists.user.js
Last active May 12, 2017 06:22
docs.ruby-lang.org ใฎใƒกใ‚ฝใƒƒใƒ‰ไธ€่ฆงใ‚’้›‘ใซๆ”น่กŒใ™ใ‚‹
// ==UserScript==
// @name pretty-docs.ruby-lang.org-method-lists
// @namespace http://tampermonkey.net/
// @version 0.2
// @description docs.ruby-lang.org ใฎใƒกใ‚ฝใƒƒใƒ‰ไธ€่ฆงใ‚’ๆ”น่กŒใ™ใ‚‹
// @author oieioi
// @match https://docs.ruby-lang.org/*.html
// @grant none
// ==/UserScript==
@oieioi
oieioi / pretty-postd.user.js
Created May 12, 2017 07:04
http://postd.cc ใฎใŠใ—ใ‚ƒใ‚Œใชใƒใƒƒใ‚ฏใ‚ฐใƒฉใ‚ฆใƒณใƒ‰ใŒ้‡ใ„ใฎใงๆถˆใ™
// ==UserScript==
// @name pretty-postd
// @namespace http://your.homepage/
// @version 0.1
// @description enter something useful
// @author You
// @match http://postd.cc/**
// @grant none
// ==/UserScript==
file_names = %w{
426.txt
427.txt
428.txt
429.txt
430.txt
431.txt
432.txt
433.txt
}
client = require 'cheerio-httpcli'
moment = require 'moment'
class DayEvents
constructor: (momentLike)->
@day = moment(momentLike)
@list = []
sample: (size = 1)->
dup = @list.concat()
HttpClient = require 'scoped-http-client'
class HipChatEmoticons
constructor: ({@authToken, @roomName})->
@list = []
url: -> "https://#{@roomName}.hipchat.com"
toArray: ->
@list.concat().map ({shortcut})-> "(#{shortcut})"
@oieioi
oieioi / arrayFlatten.coffee
Last active July 26, 2017 02:05
array flatten by coffeescript and js
[[1,2,3],[4,5,6],[7,8,9]].reduce(
((sum, v) -> sum.concat v),
[]
)