Skip to content

Instantly share code, notes, and snippets.

Avatar
🔒
crypto(graphy) rules

Ryo Kajiwara sylph01

🔒
crypto(graphy) rules
View GitHub Profile
@sylph01
sylph01 / muldrotha.txt
Created Sep 13, 2018
Muldrotha the Gravetide ver0.1
View muldrotha.txt
# Lands 36
Command Tower
Misty Rainforest
Verdant Catacombs
Polluted Delta
Breeding Pool
Watery Grave
Overgrown Tomb
Woodland Cemetery
Hinterland Harbor
View keybase.md

Keybase proof

I hereby claim:

  • I am sylph01 on github.
  • I am s01 (https://keybase.io/s01) on keybase.
  • I have a public key ASB52b64K9guFgDtc70icP9FvkNoxFumhTa_6XMvw-VMIQo

To claim this, I am signing this object:

@sylph01
sylph01 / date_arith.ex
Last active May 26, 2017
Addition/Subtraction of Erlang Date with built-in functions only
View date_arith.ex
defmodule DateArith do
def next_month({y, 12, d}), do: {y + 1, 1, d}
def next_month({y, m, d}), do: {y, m + 1, d}
def previous_month({y, 1, d}), do: {y - 1, 12, d}
def previous_month({y, m, d}), do: {y, m - 1, d}
def add_month({y, m, d}, ms) do
{
y + div(m + ms - 1, 12),
@sylph01
sylph01 / template.tex
Created Mar 27, 2017
LaTeX template for most of my stuff
View template.tex
\documentclass[11pt,a4paper]{jarticle}
%%%% settings %%%%
\usepackage{algorithmic}
\usepackage{listings,jlisting}
% lstlisting setting
% number - line number of codes
\lstset{
language={ruby},
View yhpg_e11.rb
class Node
attr_accessor :val, :children, :parent, :index
def self.divisors(n)
(1..Math.sqrt(n).ceil).flat_map { |x| if n/x == n.to_f/x then [x, n/x] else nil end}.uniq.reject(&:nil?).sort
end
def child_values
self.class.divisors(@val).map{ |x| x + 1 }.select { |x| x > 2 && x < @val }
end
View e10_input_samples
X,5
O,4
OX,10
OO,12
OXX,21
OXO,18
OOX,30
OOO,28
OXXX,81
OXXO,29
View e10_direct_answer.rb
def calculate(actions)
if actions.all?{ |c| c == 'O'}
return 2 ** (actions.count + 2) - 4
elsif actions.all?{ |c| c == 'X'}
if actions.count == 1
return 5
else
return 4 ** (actions.count - 1) + 1
end
else
View e10.rb
class Array
def x
self[0]
end
def y
self[1]
end
end
View karabiner-seil.txt
Karabiner
Do not remap internal keyboard
back-quote to kana/eisuu toggle
Seil
Change caps lock key -> 59(Left Ctrl)
Enable NFER -> 102(JIS eisuu)
Enable XFER -> 104(JIS kana)
Enable KATAKANA -> 54(Right Command)
View parse_test_case.rb
c = 1
File.open(ARGV[0]) do |f|
while l = f.gets
la = l.split("\"")
arg1 = la[1]
arg2 = la[3]
puts "test(#{c}, \"#{arg1}\", \"#{arg2}\")"
You can’t perform that action at this time.