Skip to content

Instantly share code, notes, and snippets.

View fohte's full-sized avatar

Fohte / Hayato Kawai fohte

View GitHub Profile
import sys
def remove_chars(s):
return ''.join([c for c in s if c.isdigit()])
def fizzbuzz(n):
if n % 15 == 0:
return 'fizzbuzz'
elif n % 3 == 0:
@fohte
fohte / .cvimrc
Last active May 3, 2016 06:24
The configuration file of cVim.
set smoothscroll
set linkanimations
let scrollstep = 100
map ; :
map h previousTab
map l nextTab
map [ goBack
map ] goForward
require 'chunky_png'
def log_correction(x)
(255 * Math.log(1 + x) / Math.log(1 + 255)).round
end
input_file = ARGV[0]
output_file = ARGV[1]
unless input_file && output_file
@fohte
fohte / hsv_picker.rb
Last active August 29, 2015 14:22
Create the HSV Picker Image.
require 'chunky_png'
SIZE = 100
# Create the Rectangle Value-Saturation Picker
if ARGV[0]
sv_picker = ChunkyPNG::Image.new SIZE, SIZE, ChunkyPNG::Color::TRANSPARENT
(0...SIZE).reverse_each do |y|
SIZE.times do |x|