Skip to content

Instantly share code, notes, and snippets.

View sylph01's full-sized avatar
🔒
crypto(graphy) rules

Ryo Kajiwara sylph01

🔒
crypto(graphy) rules
View GitHub Profile
require 'exif'
require 'json'
h = {}
Dir.glob('*.JPG') do |fname|
data = Exif::Data.new(File.open(fname))
h[fname] = {
focal_length: data.focal_length.to_i,
iso_speed_ratings: data.iso_speed_ratings,
(d => {
// キャッシュ対策
const s = d.createElement('script');
s.src = 'https://gist.githubusercontent.com/sylph01/11f25f175d838a97b29b2d4a320c4923/raw/e225f88e0d0d15b9aa988e82dc2930ce8ec6d44d/scoretool-unilab.js
?timestamp=' + Date.now() + 'ms';
d.head.appendChild(s);
})(document);
/*!
* ポップンスコアツール v0.3.0
*
* ポップンスコアツール is licensed under the MIT License.
* Copyright (c) 2019 ケルパニ@猫
* https://github.com/kerupani129s/popn-score-tool/blob/master/LICENSE
*/
(async () => {
const DEBUG = false;
a = [1, 2, 3, 4, 5]
class Array
def cumulative_sum(default = 0, &block)
block ||= ->(n){n}
a = [default]
for i in 1 .. (self.length)
a[i] = a[i - 1] + block.(self[i - 1])
end
return a
@sylph01
sylph01 / muldrotha.txt
Created September 13, 2018 17:06
Muldrotha the Gravetide ver0.1
# Lands 36
Command Tower
Misty Rainforest
Verdant Catacombs
Polluted Delta
Breeding Pool
Watery Grave
Overgrown Tomb
Woodland Cemetery
Hinterland Harbor

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 05:55
Addition/Subtraction of Erlang Date with built-in functions only
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 March 27, 2017 07:16
LaTeX template for most of my stuff
\documentclass[11pt,a4paper]{jarticle}
%%%% settings %%%%
\usepackage{algorithmic}
\usepackage{listings,jlisting}
% lstlisting setting
% number - line number of codes
\lstset{
language={ruby},
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
X,5
O,4
OX,10
OO,12
OXX,21
OXO,18
OOX,30
OOO,28
OXXX,81
OXXO,29