This file contains 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
require 'RMagick' | |
require 'rubygems' | |
def crop_icons(filename) | |
original = Magick::Image.read(filename).first | |
prefix = File.basename(filename, ".*") | |
image = original.crop(356, 15, 53, 60) | |
image.write("icons/#{prefix}-1.jpg") |
This file contains 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...100000).to_a.each{`git commit --allow-empty -m "commit"`} |
This file contains 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
require 'parser/current' | |
str = <<-FOO | |
def hoge | |
# this is comment | |
pp"this is test" | |
end | |
FOO | |
Parser::CurrentRuby.parse_with_comments str |
This file contains 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
def words | |
[ | |
'Youtuber', | |
'バーチャル', | |
'のじゃロリ', | |
'おじさん', | |
'狐娘', | |
'ケモミミ', | |
'おばさん', | |
'底辺', |
This file contains 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
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") |
This file contains 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
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() | |
This file contains 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
curl -X PUT --user "id:pass" -d "user[current_password]=XXXXXXXX&user[password]=new_XXXXXXXX" https://XXXXXX.com |jq . |
This file contains 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
heroku logs --tail -a your-app-name |
This file contains 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
git rev-list --format=oneline --max-count=10000 HEAD |
This file contains 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
mimetypeを取得 | |
let mimeType:String = UTTypeCopyPreferredTagWithClass(string as! CFString, kUTTagClassMIMEType)!.takeRetainedValue() as String |