Skip to content

Instantly share code, notes, and snippets.

(1...100000).to_a.each{`git commit --allow-empty -m "commit"`}
require 'parser/current'
str = <<-FOO
def hoge
# this is comment
pp"this is test"
end
FOO
Parser::CurrentRuby.parse_with_comments str
@colorbox
colorbox / fox.rb
Last active December 9, 2017 17:08
バーチャルのじゃロリ狐娘Youtuberおじさん
def words
[
'Youtuber',
'バーチャル',
'のじゃロリ',
'おじさん',
'狐娘',
'ケモミミ',
'おばさん',
'底辺',
defmodule Executor do
def exec do
Solver.test("44165,44516", "false")
Solver.test("26265,31436", "true")
Solver.test("46345,54215", "true")
Solver.test("62143,11152", "false")
Solver.test("4242,4314,1562", "false")
Solver.test("5612,3656,4523", "false")
Solver.test("5514,1311,5252", "false")
Solver.test("5262,4631,2644", "true")
list = "AAAA"
(for x <- String.split(list,"")|>Enum.drop(-1), do: ([0,0,0] ++ Integer.digits(elem(Code.eval_string("0x"<>x),0),2))|>Enum.take(-4) )|> List.flatten()|> Enum.join()
@colorbox
colorbox / curl-with-basic
Created April 14, 2017 02:01
curl with basic and jq
curl -X PUT --user "id:pass" -d "user[current_password]=XXXXXXXX&user[password]=new_XXXXXXXX" https://XXXXXX.com |jq .
heroku logs --tail -a your-app-name
@colorbox
colorbox / git-commit-word-extractor
Created April 14, 2017 02:00
git log commit message extract
git rev-list --format=oneline --max-count=10000 HEAD
mimetypeを取得
let mimeType:String = UTTypeCopyPreferredTagWithClass(string as! CFString, kUTTagClassMIMEType)!.takeRetainedValue() as String
require'nokogiri'
require'open-uri'
body = open("https://www.amazon.co.jp/gp/bestsellers/digital-text/2293143051", &:read)
doc = Nokogiri::HTML(body)
doc.xpath("//div[@class='zg_itemRow']")