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 / 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 / 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 / clean_python.md
Created April 2, 2019 08:56
Clean python
condition = True

if condition:
    x = 1
else:
    x = 0

print(x)
@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 / 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 / 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 / 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 / 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 / install_ccmake.md
Created December 28, 2018 19:45
install ccmake on ubuntu

18.04_LTS

sudo apt install cmake-curses-gui
@koji
koji / swap_ubuntu.md
Created December 26, 2018 18:51
swap file for ubuntu
$ sudo cat /proc/swaps
$ sudo mkdir /var/swap/
$ sudo dd if=/dev/zero of=/var/swap/swap0 bs=2M count=2048
  2M x 2048 = 4.3GB
$ sudo chmod 600 /var/swap/swap0
$ sudo mkswap /var/swap/swap0
$ sudo swapon /var/swap/swap0
$ sudo vim /etc/fstab
add: /var/swap/swap0 swap swap defaults 0 0