Skip to content

Instantly share code, notes, and snippets.

View hw0k's full-sized avatar
🎯

Hyunwook Nam hw0k

🎯
  • localhost
  • 12:38 (UTC +09:00)
View GitHub Profile
@hw0k
hw0k / createPage.js
Last active June 28, 2020 09:53
FND 6
function createPage({ title, body, tags, actions }) { /* ... */ }
// usage
createPage({
title: 'Hello world!',
body: 'bodybodybody',
tags: ['onboarding'],
actions: [],
});
@hw0k
hw0k / createPage.js
Last active June 28, 2020 09:53
FND 5
function createPage(title, body, tags, actions) { /* ... */ }
// usage
createPage('Hello world!', 'bodybodybody', ['onboarding'], []);
@hw0k
hw0k / send.js
Last active June 28, 2020 09:14
FND 4
async function sendNotifications() {
const preferences = await UserPreferencesRepository.findAll();
preferences
.filter(isPreferenceHasAllowedNotification)
.forEach(NotificationModule.send);
}
function isPreferenceHasAllowedNotification(preference) {
return preference.hasAllowedNotification;
@hw0k
hw0k / send.js
Last active June 28, 2020 09:03
FND 3
async function sendNotifications() {
const preferences = await UserPreferencesRepository.findAll();
preferences.forEach(preference => {
if (preference.hasAllowedNotification) {
NotificationModule.send(preference);
}
});
}
@hw0k
hw0k / checkDevice.js
Last active June 28, 2020 08:33
FND 2
async function checkS10(deviceName) {
return deviceName.includes('Galaxy S10');
}
@hw0k
hw0k / checkDevice.js
Last active June 28, 2020 08:27
FND 1
import DeviceInfo from 'react-native-device-info';
async function checkS10() {
const deviceName = await DeviceInfo.getDeviceName();
return deviceName.includes('S10');
}
_ _ _
>(.)__ <(.)__ =(.)__
(___/ (___/ (___/
🌞 Morning 27 commits █████▌░░░░░░░░░░░░░░░ 26.2%
🌆 Daytime 40 commits ████████▏░░░░░░░░░░░░ 38.8%
🌃 Evening 21 commits ████▎░░░░░░░░░░░░░░░░ 20.4%
🌙 Night 15 commits ███░░░░░░░░░░░░░░░░░░ 14.6%
@hw0k
hw0k / Brewfile
Last active January 21, 2021 17:11
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "homebrew/services"
brew "nodenv"
brew "watchman"
cask "notion"
cask "iterm2"
cask "google-chrome"
cask "openjdk@11"
@hw0k
hw0k / index.ts
Last active April 13, 2020 10:25
FP Intro 9
function* infiniteValue(acc = 0) {
yield acc;
yield* infiniteValue(acc + 1);
}
const iter = infiniteValue();
console.log(iter.next().value); // 0
console.log(iter.next().value); // 1
console.log(iter.next().value); // 2
console.log(iter.next().value); // 3