Skip to content

Instantly share code, notes, and snippets.

View funatsufumiya's full-sized avatar

Fumiya Funatsu funatsufumiya

View GitHub Profile
@funatsufumiya
funatsufumiya / hsv_to_rgb.glsl
Created August 10, 2014 10:58
GLSL convert from HSV(A) to RGB(A)
vec4 hsv_to_rgb(float h, float s, float v, float a)
{
float c = v * s;
h = mod((h * 6.0), 6.0);
float x = c * (1.0 - abs(mod(h, 2.0) - 1.0));
vec4 color;
if (0.0 <= h && h < 1.0) {
color = vec4(c, x, 0.0, a);
} else if (1.0 <= h && h < 2.0) {
@funatsufumiya
funatsufumiya / gif2mp4
Last active August 29, 2015 14:07
gif2mp4
#!/usr/bin/env tcsh -f
set gif = $argv[1]
set loop = $argv[2]
set mp4 = $argv[3]
set framerate = $argv[4]
if($loop < 1) then
echo "loop must >0"
exit
@funatsufumiya
funatsufumiya / linked-list.c
Created January 24, 2015 04:08
LinkedList implemented in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define DEBUG
typedef int VALUE;
typedef struct linkedList {
VALUE head;
@funatsufumiya
funatsufumiya / script.js
Last active February 3, 2016 04:42
Lancersで終了済みのタスクを灰色表示するためのスクリプト(for Chrome's CJS plugin)
jQuery(function($){
if(location.href.indexOf("http://www.lancers.jp/work/") === 0){
var proposes = $("table.prof > tbody > tr > td.stats.propose");
proposes.each(function(e){
var $this = $(this);
if($this.children().length === 3){
var current = $this.children()[1].innerText;
var t = $this.children()[2].innerText;
var r = /^\(募集 ([0-9]+)件\)$/;
var total = t.match(r)[1];
@funatsufumiya
funatsufumiya / regoentry-1-automation-for-cjs.js
Last active August 29, 2015 14:16
Useful tools for regoentry
var url = location.href;
if(/entry\/index\/?$/.test(url)){
var s = $('.menu_count').text();
if(s == "0000000" && typeof q === 'undefined'){
console.log("reload");
setTimeout(function(){
location.href = location.href;
}, 5000);
}else{
var list = [];
@funatsufumiya
funatsufumiya / create-mp4-with-sound.rb
Created April 8, 2015 06:45
Easy movie creator with sound and image. It generates h.264 movie, using ffmpeg
#!/usr/bin/env ruby
if ARGV.size < 3
puts "usage: comnand [audio-file] [image-file] [out-file.mp4]"
else
`ffmpeg -i #{ARGV[0]} -loop 1 -i #{ARGV[1]} -vcodec libx264 -preset slow -crf 20 -threads 0 -shortest -ar 44100 #{ARGV[2]}`
end
@funatsufumiya
funatsufumiya / stereogramify.pde
Last active September 6, 2015 08:19
stereogramify.pde
import controlP5.*;
//import gifAnimation.GifMaker;
import java.awt.*;
ControlP5 cp5;
String filenameA = null;
String filenameB = null;
void setup(){
@funatsufumiya
funatsufumiya / j-lyric.netで歌詞をコピー.js
Created September 3, 2015 16:13
j-lyric.netで歌詞をコピーするブックマークレット
javascript:var e=document.getElementById("lyricBody");var html=e.innerHTML;var s=html.split(/[\n]/).join("")/*.split(/<br\/?>/).join("\n")*/;document.body.innerHTML=("<p>"+s+"</p>")+document.body.innerHTML;
@funatsufumiya
funatsufumiya / fpsTest1.pde
Last active September 6, 2015 07:21
FPS check - Processing vs OpenFrameworks
void setup(){
size(600,600,P3D);
}
void draw(){
background(0);
noStroke();
fill(255);
text(frameRate,50,50);
@funatsufumiya
funatsufumiya / gotty-server
Last active September 6, 2015 08:17
gotty-server (Access from network, or set IP)
#!/bin/sh
if [ $# -lt 1 ]; then
gotty -a 0.0.0.0 -p 9999 -w tmux
else
gotty -a $1 -p 9999 -w tmux
fi