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 / codility.md
Last active February 21, 2020 00:38
codility
function solution(A) {
  let result = 0;

  for (let element of A) {
    result ^= element
  }

  return result
}
@koji
koji / react-native_for_android.md
Last active January 29, 2020 02:30
react-native settings for android

1. install watchman

$ brew install watchman

2. install jdk

brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk8
@koji
koji / uninstall_nodejs_package_version.md
Created January 26, 2020 20:48
Uninstall nodejs of package version
$ /usr/local/bin/node -v
v13.7.0

$ sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}

$ /usr/local/bin/node -v
zsh: no such file or directory: /usr/local/bin/node
@koji
koji / react.md
Last active September 12, 2019 03:39
for reactjs

in chrome

$r.store
$r.store.getState()
$r.store.dispatch()
@koji
koji / pipenv_issue_homebrew.md
Created September 5, 2019 15:41
pipenv issues on Homebrew
Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/bin/pipenv", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3241, in <module>
    @_call_aside
  File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3225, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
@koji
koji / print_obj.js
Created August 15, 2019 19:25
display full object
const print = (obj:any) => {
console.log(JSON.stringify(obj, null, 4));
}
@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;
@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 / 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