Skip to content

Instantly share code, notes, and snippets.

View allenhwkim's full-sized avatar

Allen Kim allenhwkim

View GitHub Profile
@allenhwkim
allenhwkim / sublime3-settings.md
Last active December 4, 2019 07:17
Sublime3 For TypeScript/Vim/Terminal User Settings
@allenhwkim
allenhwkim / react-min-example.html
Last active September 11, 2017 00:46
Min. React Example
<!DOCTYPE html>
<html>
<body>
<script src="https://fb.me/react-15.0.0.js"></script>
<script src="https://fb.me/react-dom-15.0.0.js"></script>
<script src="https://unpkg.com/babel-standalone/babel.min.js"></script>
<script type="text/babel">
const style = {
backgroundColor: 'grey',
fontSize: '24px'
@allenhwkim
allenhwkim / vue-min-examle.html
Created September 11, 2017 00:44
Vue Min Example
<!DOCTYPE html>
<html>
<body>
<script src="//unpkg.com/vue/dist/vue.min.js"></script>
<div id="hello-world" v-on:click="msg++">
Hello {{ msg }}
</div>
<script>
new Vue({
el: "#hello-world",
@allenhwkim
allenhwkim / plunker-submit.js
Last active September 20, 2017 18:21
Create a plunker page from javascript form submisstion
class PlunkerSubmit {
constructor() {
this.formFields = [];
this.indexHeads = [];
this.indexBody = '';
}
setDescription(description) {
this.formFields.push({name: 'description', value: description});
@allenhwkim
allenhwkim / utf16.js
Created September 21, 2017 02:43
Return string formatted utf16 expression from a character
function toUTF16(codePoint) {
var TEN_BITS = parseInt('1111111111', 2);
function u(codeUnit) {
return '\\u'+codeUnit.toString(16).toUpperCase();
}
if (codePoint <= 0xFFFF) {
return u(codePoint);
}
codePoint -= 0x10000;
@allenhwkim
allenhwkim / MDC Example.md
Last active October 7, 2017 02:24
Material Design Examples
<!DOCTYPE html>
<html>
<head>
<script>
class AppDrawer extends HTMLElement {
//...
}
window.customElements.define('app-drawer', AppDrawer);
</script>
</head>
@allenhwkim
allenhwkim / ce-common.css
Created October 11, 2017 17:23
Custom Element Common Css
:root {
font-family: Roboto, sans-serif;
--theme-primary: #212121;
--theme-text-primary: #fff;
--theme-shadow-4dp:
0px 2px 4px -1px rgba(0, 0, 0, 0.2),
0px 4px 5px 0px rgba(0, 0, 0, 0.14),
0px 1px 10px 0px rgba(0, 0, 0, 0.12);
}
.float-left {
@allenhwkim
allenhwkim / starting-webpack.md
Last active November 6, 2017 17:23
Starting Webpack

Starting Webpack

Simple Example

index.js

import bar from './bar';
bar();

bar.js

@allenhwkim
allenhwkim / map-marker.js
Last active November 22, 2017 19:47
Custom Element Example(Map/Marker)
class GoogleMap extends HTMLElement{
connectedCallback() {
this.map = new google.maps.Map(this, {center:{lat: -25.363, lng: 131.044}, zoom:4 });
this.initMarkers();
}
initMarkers() {
setTimeout(_ => {
Array.from(this.querySelectorAll('a-marker')).forEach(el => {
el.init(this.map);
})