This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)-> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'color_echo' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name pretty-postd | |
// @namespace http://your.homepage/ | |
// @version 0.1 | |
// @description enter something useful | |
// @author You | |
// @match http://postd.cc/** | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file_names = %w{ | |
426.txt | |
427.txt | |
428.txt | |
429.txt | |
430.txt | |
431.txt | |
432.txt | |
433.txt | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client = require 'cheerio-httpcli' | |
moment = require 'moment' | |
class DayEvents | |
constructor: (momentLike)-> | |
@day = moment(momentLike) | |
@list = [] | |
sample: (size = 1)-> | |
dup = @list.concat() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpClient = require 'scoped-http-client' | |
class HipChatEmoticons | |
constructor: ({@authToken, @roomName})-> | |
@list = [] | |
url: -> "https://#{@roomName}.hipchat.com" | |
toArray: -> | |
@list.concat().map ({shortcut})-> "(#{shortcut})" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[1,2,3],[4,5,6],[7,8,9]].reduce( | |
((sum, v) -> sum.concat v), | |
[] | |
) |