Skip to content

Instantly share code, notes, and snippets.

View fohte's full-sized avatar

Fohte / Hayato Kawai fohte

View GitHub Profile
@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|
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 / .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
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:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity calc is
generic (
DIV_BITS: integer := 20;
SEGMENT_CLEAR: std_logic_vector(7 downto 0) := "11111111";
SEGMENT_0: std_logic_vector(7 downto 0) := "00000011";
SEGMENT_1: std_logic_vector(7 downto 0) := "10011111";
@fohte
fohte / dvorak.txt
Created February 28, 2017 11:12
My dvorak layout (from minimal DvorakJP) for Japanese on Google IME
- ー
~ 〜
. 。
, 、
;/ ・
;. …
;, ‥
;h ←
;j ↓
;k ↑
tap 'caskroom/cask'
tap 'homebrew/boneyard'
tap 'homebrew/bundle'
tap 'homebrew/core'
tap 'homebrew/dupes'
tap 'homebrew/python'
tap 'homebrew/science'
tap 'neovim/neovim'
tap 'osx-cross/avr'
tap 'sanemat/font'
{
"ecmaVersion": 6,
"libs": [
"browser"
],
"loadEagerly": [
"./client/app/**/*.js"
],
"dontLoad": [
"**/node_modules/!(react*|redux)/**/*.js"
{
"alfredtheme" : {
"result" : {
"textSpacing" : 4,
"subtext" : {
"size" : 11,
"colorSelected" : "#EBEBEBFF",
"font" : "Menlo",
"color" : "#929292FF"
},
package main
import (
"fmt"
"os"
"strconv"
"strings"
"testing"
)