Skip to content

Instantly share code, notes, and snippets.

View r9y9's full-sized avatar
:shipit:
( ˘ω˘ ) zzz

Ryuichi Yamamoto r9y9

:shipit:
( ˘ω˘ ) zzz
View GitHub Profile
@r9y9
r9y9 / gist:5473643
Created April 27, 2013 16:19
Pythonで離散フーリエ変換
#!/usr/bin/python
# coding: utf-8
import sys
import os
import wave
import numpy as np
import pylab as pl
def dft_test(filename):
@r9y9
r9y9 / fonts_install.sh
Last active October 9, 2019 05:41
Font install script for MigMix 1P, Migu 1M, Inconsolata, Ricty and Ricty for Powerline.
#!/bin/bash
# Requirement: wget, unzip, git and fontforge
function check_requirement() {
messages=()
for r in "wget" "unzip" "git" "fontforge"
do
[ -z `which $r` ] && messages+=($r)
done
if [ ${#messages[@]} -gt 0 ]
@r9y9
r9y9 / blogger-custom.css
Last active December 20, 2015 07:39
CSS customization for blogger
//@import url(http://fonts.googleapis.com/css?family=Roboto:400,300);
//@import url(http://fonts.googleapis.com/css?family=Russo+One);
body, textarea {
font-family:'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック',sans-serif;
}
.Header h1 {
font-family: 'Russo One', sans-serif;
}
@r9y9
r9y9 / install_roboto.sh
Created August 11, 2013 07:22
Roboto install script
#!/bin/bash
function install_roboto() {
mkdir roboto
wget -O roboto/roboto.zip "https://developer.android.com/downloads/design/Roboto_Hinted_20120823.zip"
unzip roboto/roboto.zip -d roboto/
mv -vf roboto/*.ttf ~/.fonts
rm -vrf roboto
}
@r9y9
r9y9 / ribon.html
Created September 28, 2013 04:35
Ribon
<div style="position: absolute; top: 50px; right: -150px; width: 400px; padding: 10px; font-size: 16px; text-align: center; color: rgb(255, 255, 255); font-family: 'trebuchet ms', verdana, arial, sans-serif; -webkit-transform: rotate(+45deg); -webkit-transform-origin: 50% 0px; background-color: rgb(0, 0, 0); border: 1px solid rgb(170, 170, 170); z-index: 12; opacity: 0.5;"><a target="_blank" style="text-decoration: none" href="https://twitter.com/r9y9">Follow me</a></div>
@r9y9
r9y9 / doxygen_template.conf
Last active July 30, 2020 14:47
My Doxygen template
# Doxyfile 1.8.5
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
@r9y9
r9y9 / mlsa_filter.h
Last active February 15, 2023 11:07
MLSA digital filter for speech synthesis in C++
#pragma once
#include <cmath>
#include <memory>
#include <vector>
#include <cassert>
namespace sp {
/**
@r9y9
r9y9 / dft.go
Created December 23, 2013 11:53
Discrete Fourier Transform in Go
package main
import "math"
import "fmt"
func DFT_naive (input []float64) ([]float64, []float64) {
real := make([]float64, len(input))
imag := make([]float64, len(input))
arg := -2.0*math.Pi/float64(len(input))
for k := 0; k < len(input); k++ {
@r9y9
r9y9 / fizzbuzz.go
Last active January 1, 2016 09:59
Fizz buzz in go
package main
import "fmt"
func FizzBuzz (i int) string {
switch {
case i % 3 == 0 && i % 5 == 0:
return "fizz buzz"
case i % 3 == 0:
return "fizz"
@r9y9
r9y9 / server.go
Created December 27, 2013 02:19
An example of concurrency best practices from http://talks.golang.org/2013/bestpractices.slide#28
package main
import (
"fmt"
"time"
)
type Server struct {
quit chan bool
}