Skip to content

Instantly share code, notes, and snippets.

View imskojs's full-sized avatar
🎯
Focusing

Seunghoon Ko imskojs

🎯
Focusing
  • Seoul, Korea
View GitHub Profile
@imskojs
imskojs / stream-cell-operator-generalized-pattern.ts
Last active April 19, 2019 01:49
Stream Cell Operator Generalized Pattern.
import { Component, OnInit } from '@angular/core';
import { Observable, Subject, BehaviorSubject, merge } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators'
@Component({
selector: 'stream-cell-operator-basics',
styleUrls: ['./stream-cell-operator-basics.component.css'],
template:
`<button (click)="redButtonA$.next()">
@imskojs
imskojs / setup.sh
Last active February 13, 2019 07:57
sudo apt purge -y nvidia*
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/410.93/NVIDIA-Linux-x86_64-410.93.run
wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64
sudo chmod +x NVIDIA-Linux-x86_64-410.93.run
sudo sh NVIDIA-Linux-x86_64-410.93.run -q -a -n -X -s
sudo dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64
sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
sudo apt-get update
// Returns All prototypical chain of an object.
function protos(obj) {
var result = [];
function diver(obj){
if(obj.__proto__){
result.push(obj.__proto__.constructor);
} else {
result.push(null);
return false;
}
// Returns All prototypical chain of an object.
function protos(obj) {
var result = [];
function diver(obj){
if(obj.__proto__){
result.push(obj.__proto__);
} else {
return false;
}
diver(obj.__proto__);
// x is an Object object, not an array
var x = Object.create(Array.prototype)
// verify that x is definitely not an array
Array.isArray(x); // output: false
// but, x has array mehods like push
x.push('apple')
// seems to work just like an array
function randomFunc () {
var msg = 'How can a function have a property?';
return msg;
}
var x = randomFunc.prototype.constructor
// Expected undefined got 'randomFunc'
@imskojs
imskojs / PreventGhostClick.js
Created December 15, 2018 00:21 — forked from jtangelder/PreventGhostClick.js
PreventGhostClick
/**
* Prevent click events after a touchend.
*
* Inspired/copy-paste from this article of Google by Ryan Fioravanti
* https://developers.google.com/mobile/articles/fast_buttons#ghost
*
* USAGE:
* Prevent the click event for an certain element
* ````
* PreventGhostClick(myElement);
@imskojs
imskojs / normalized.html
Created July 2, 2018 03:22 — forked from scottkellum/normalized.html
pixel normalization
<!doctype html>
<html>
<head>
<!-- Encoding -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>

Set up quasar with @vue-cli

npm install -g @vue/cli
vue create PROJECT_NAME

Vue CLI v3.0.0-rc.3 ? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, PWA, Router, Vuex, CSS Pre-processors, Linter, Unit, E2E
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Stylus
? Pick a linter / formatter config: Basic