Skip to content

Instantly share code, notes, and snippets.

:octocat:
Working from home

Sung M. Kim dance2die

:octocat:
Working from home
Block or report user

Report or block dance2die

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist css.jsx
export default ({}) => {
return (
<Layout>
<SEO
frontmatter={frontmatter}
url={new URL(slug, siteUrl).href || siteUrl}
/>
<Link to={`/blog/${year}`}>&larr; Go Back</Link>
👇
{/* This "link" is for styling gists. */}
View Draft 1- Beginner's Thread Easy Questions (November 2019).md

Beginner's Thread / Easy Questions (November 2019)

[Previous threads][wiki previous threads] can be found in the Wiki.

Got questions about React or anything else in its ecosystem? Stuck making progress on your app?
Ask away! We’re a friendly bunch.

No question is too simple. 🙂


View Move Markdown to respective folder.ps1
ls | % {
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_split?view=powershell-6
$parsed = $_.Name -split '(\d{4})-(\d{2})-(\d{2})-(.*)'
$year = $parsed[1];
$month = $parsed[2];
$day = $parsed[3];
$name = $parsed[4];
$newDir = "$year/$month/$day";
View Implementation using "takeUntil".ts
// Original code
const pingEpic = (
action$,
) => (
action$
.pipe(
ofType(PING),
delay(1000),
map(pong),
)
View pingEpic.ts
export const pingEpic = action$ =>
action$.pipe(
ofType(PING),
// 1️⃣ from "delay(1000)" to 👇
switchMap(() => timer(1000)),
mapTo(pong()),
tap(console.info)
);
// 2️⃣ pongEpic stays the same.
View ping.ts
import { ofType } from "redux-observable";
import { mapTo, tap, delay } from "rxjs/operators";
export const PING = "PING";
export const PONG = "PONG";
export const ping = () => ({ type: PING });
export const pong = () => ({ type: PONG });
export const pingEpic = action$ =>
View Allow port 22 & push
dance2die@dokku:~/node-js-getting-started$ git push dokku master
Enter passphrase for key '/home/dance2die/.ssh/id_rsa':
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 291 bytes | 291.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
-----> Cleaning up...
-----> Building node-js-getting-started from herokuish...
-----> Adding BUILD_ENV to build environment...
View Install SSH server, open port and deploy
# Install Open SSH server & client
sudo apt install openssh-server openssh-client
# Open port 22 to allow connection
sudo ufw allow 22
# Deploy the code to Dokku
git push dokku master
View add remote repo
# 1️⃣ 2️⃣ 3️⃣ 4️⃣
git remote add dokku dokku@dokku:node-js-getting-started
View create dokku app
dokku apps:create node-js-getting-started
You can’t perform that action at this time.