This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('Hello, world!') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button id="btn-1" class="blue-default"> | |
<div class="ripple-area"></div> | |
</button> | |
<button id="btn-2" class="blue-text"> | |
<div class="ripple-area"></div> | |
</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
// Log file name, EOL (Different by platform) | |
console['config'] = { file: 'log.txt', eol: require('os').EOL } | |
console['_log'] = console.log // Original console.log function to console._log | |
console.log = function () { // substitution | |
let args = (arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)).join(' ') | |
fs.appendFileSync(console.config['file'], args + console.config['eol']) // save | |
console._log(args) // print | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference: https://gist.github.com/tsl0922/d79fc1f8097dde660b34 | |
# If text color issue in tmux terminal, type this commend | |
# alias tmux="TERM=screen-256color-bce tmux" | |
set-option -g prefix C-a | |
unbind-key C-a | |
bind-key C-a send-prefix | |
set -g base-index 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# [Oh My Zsh] Would you like to check for updates? | |
# Type Y to update oh-my-zsh: Y | |
# Upgrading Oh My Zsh | |
# Cannot pull with rebase: You have unstaged changes. | |
# Please commit or stash them. | |
# There was an error updating. Try again later? | |
# | |
# [Set permission] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* TC39 Proposal : https://github.com/tc39/proposal-optional-chaining | |
*/ | |
Object.prototype.optionalChain = function (...ops) { | |
let curr = this | |
for (let op of ops) { | |
if (curr[op] == null) { | |
return | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Spread syntax trick 1 | |
* Rest parameter | |
*/ | |
const sum = (acc, ...nums) => { | |
for (let num of nums) { | |
acc += num | |
} | |
return acc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Spread syntax trick 2 | |
* Immutable data pattern | |
*/ | |
const a = { | |
name: 'Tom', | |
age: 10 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Spread syntax trick 3 | |
* Optional spreading | |
*/ | |
const available = true | |
const obj = { | |
user: 'James', | |
age: 16, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 알림 구독 | |
function subscribe () { | |
const applicationServerKey = urlB64ToUint8Array(appServerPublicKey); | |
swRegist.pushManager.subscribe({ | |
userVisibleOnly: true, | |
applicationServerKey: applicationServerKey | |
}) | |
.then(subscription => { | |
console.log('User is subscribed.'); | |
updateSubscription(subscription); |
OlderNewer