Skip to content

Instantly share code, notes, and snippets.

View koji's full-sized avatar
🔍
I may be slow to respond.

koji koji

🔍
I may be slow to respond.
View GitHub Profile
@koji
koji / runway_osc_test.md
Last active January 20, 2019 07:27
runway osc test

runway(v0.1.4) settings
input camera
output osc

ofApp.h

#pragma once

#include "ofMain.h"
#include "ofxOsc.h"
@koji
koji / nodejs_file_size.md
Created January 30, 2019 21:25
get file size with nodejs

get file size

const fs = require('fs');
const stat = fs.statSync("file path");
console.log(stat.size);
@koji
koji / cron_task.md
Last active February 16, 2019 20:28
cron

create shellscript

$ mkdir TakePhotos
$ cd TakePhotos
$ vim runCamera.sh

install fswebcam

$ sudo apt-get install fswebcam
@koji
koji / spotify_api.md
Last active March 22, 2019 01:48
spotify_api

preparation

$ mkdir spotifyapi (whatever you want)
$ cd spotifyapi
$ npm init -y
$ npm install spotify-web-api-node --save

app.js

@koji
koji / pi_and_bluetooth.md
Created April 2, 2019 06:59
bluetooth and raspberry pi

install

$ sudo apt-get install pulseaudio pavucontrol
$ pulseaudio -D
$ sudo apt-get install pi-bluetooth blueman pulseaudio-module-bluetooth

turn on bluetooth

@koji
koji / clean_python.md
Created April 2, 2019 08:56
Clean python
condition = True

if condition:
    x = 1
else:
    x = 0

print(x)
@koji
koji / docker_ubuntu_desktop.md
Created April 9, 2019 04:08
Create Ubuntu Desktop with Docker

Setup

$ docker pull ubuntu
$ docker run --name ubuntu-xrdp -it ubuntu bash
inside docker
$ apt-get update -y
$ apt-get upgrade -y
$ apt-get install xrdp -y
$ apt-get install lxde
$ apt-get install net-tools
@koji
koji / js_console.md
Created April 22, 2019 00:36
Console.log + alpha

console.table

const foo = { id: 1, verified: true, color: 'green' };
const bar = { id: 2, verified: false, color: 'red' };
console.table({ foo, bar})

console.group

console.group('User Details');
@koji
koji / fs_to_us.md
Last active July 6, 2019 22:01
FragmentShader to Unity Shader
vec<n>  --> float<n>
vec2 --> float2
vec3 --> float3

texture --> tex2D

u_time --> _Time.y

atan(x,y) --&gt; atan2(y,x)
@koji
koji / sample.frag
Created July 15, 2019 16:54
texture
#ifdef GL_ES
precision mediump float;
#endif
uniform float u_time;
uniform vec2 u_resolution;
uniform sampler2D u_tex0;