Skip to content

Instantly share code, notes, and snippets.

View wonism's full-sized avatar
๐Ÿ‘จโ€๐Ÿ’ป
undefined !== null

Jaewon wonism

๐Ÿ‘จโ€๐Ÿ’ป
undefined !== null
View GitHub Profile
@wonism
wonism / pr.sh
Last active August 24, 2020 04:02
Command for opening a gh link to create a pull request from current working branch.
#!/bin/bash
function pr() {
url=$(git config --get remote.origin.url)
if [[ $url =~ "http" ]]; then
url=$(echo $url | sed -e "s/\.git//")
else
url=$(echo $url | sed -e "s/\:/\//" -e "s/git@/https:\/\//" -e "s/\.git//")
fi
@sebmarkbage
sebmarkbage / The Rules.md
Last active October 14, 2025 16:22
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@cryppadotta
cryppadotta / 001-Tradingview-Watchlist.md
Last active September 20, 2025 07:35
Tradingview Watchlist Import Files for Crypto Exchanges

Tradingview Watchlist Import Files for Crypto Exchanges

Below you'll find Tradingview import files for Bittrex and Binance BTC-base markets

Ordered by CMC's Market Cap

I use Tradingview and I like to quickly click through all coins on a particular exchange. The files below can be imported into a Tradingview watchlist.

โ˜… โ˜… โ˜… If you use these, leave a comment or a star above โ˜… โ˜… โ˜…

@nepsilon
nepsilon / 2-front-end-tips-to-keep-in-mind.md
Last active October 10, 2025 12:36
2 front-end tips to keep in mind โ€” First published in fullweb.io issue #68

2 front-end tips to keep in mind

1. Stop using .innerHTML = ''; when removing children to a DOM element.

On modern browsers it seems to be about 400ร— (!!) slower than this DOM-friendly method:

while (el.firstChild)
    el.removeChild(el.firstChild);
@nepsilon
nepsilon / simple-cache-busting-with-nginx.md
Created September 20, 2016 03:39
Simple cache busting with Nginx โ€” First published in fullweb.io issue #66

Simple cache busting with Nginx

You update your app.js or styles.css, but have a caching of 30 days and none of the clients will get the latest version? ๐Ÿ˜Ÿ

While the best would be to use a build mechanism to generate new filenames on the server, here is how to ensure clients get your last updates:

1. Change the name of the files in the HTML, for example styles.css to styles.123.css

2. Add this cache busting snippet in your nginx conf:

@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
@nepsilon
nepsilon / a-better-setup-for-git.md
Last active October 19, 2020 19:15
A better setup for Git โ€” First published in fullweb.io issue #46

A better setup for Git

Git default configuration is good but it can be personalized to improve your workflow efficiency. Here are some good lines to put in your ~/.gitconfig:

# The basics, who you commit as:
[user]
  name = John Doe
  email = john@doe.org
@sindresorhus
sindresorhus / post-merge
Last active September 26, 2025 13:35
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT ยฉ Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@safe1981
safe1981 / Gist๋ฅผ ์ด์šฉํ•œ ์†Œ์Šค๊ด€๋ฆฌ.markdown
Last active February 23, 2019 04:55
Article:Gist์™€ Sublime์„ ์ด์šฉํ•œ Code Snippet๊ด€๋ฆฌ

#Gist๋ฅผ ์ด์šฉํ•œ ์ฝ”๋“œ์กฐ๊ฐ๊ด€๋ฆฌ ์ด๋ฒˆ ๊ธ€์—์„œ๋Š” Code Snippet์ด๋ผ ๋ถˆ๋ฆฌ๋Š” ์ฝ”๋“œ์กฐ๊ฐ์„ ํšจ๊ณผ์ ์œผ๋กœ ์–ด๋–ป๊ฒŒ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์„๊นŒ์— ๋Œ€ํ•œ ํ•˜๋‚˜์˜ ๋ฐฉ๋ฒ•์„ ๋…ผํ•˜๊ณ ์ž ํ•œ๋‹ค. ๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•˜๋‹ค๋ณด๋ฉด ๋ฌด์ˆ˜ํžˆ ๋งŽ์€ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๊ฒŒ ๋œ๋‹ค. ๋•Œ๋•Œ๋กœ ์ž‘์„ฑํ•œ ์ฝ”๋“œ ์ค‘์˜ ์ผ๋ถ€๋ฅผ ๋‚˜์ค‘์—๋„ ํ™œ์šฉํ•ด๋ณด๊ธฐ ์œ„ํ•ด ์ฝ”๋“œ๋ฅผ ๋ถ„๋ฅ˜ํ•œ๋‹ค. ๋Œ€์ฒด๋กœ ์ด๋Ÿฐ ๊ฒฝ์šฐ ์ž์‹ ๋งŒ์˜ ๋ฉ”๋ชจ์žฅ์„ ํ™œ์šฉํ•˜๊ฑฐ๋‚˜, ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” ์—๋””ํ„ฐ๋ฅผ ํ™œ์šฉํ•ด์„œ ์ด๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๊ฒฝํ–ฅ์ด ์žˆ๋‹ค. ํ•˜์ง€๋งŒ ์ด๋Ÿฐ ๋ฐฉ๋ฒ•์€ ์ฝ”๋“œ๊ฐ€ ๋งŽ์•„์งˆ์ˆ˜๋ก ๊ฒ€์ƒ‰ํ•˜๊ธฐ๊ฐ€ ์‰ฝ์ง€ ์•Š๊ณ , ๊ฐœ๋ฐœ์–ธ์–ด์— ๋”ฐ๋ผ ํšจ์œจ์ ์œผ๋กœ ์ฝ”๋“œ๋ฅผ ๊ด€๋ฆฌํ•˜๊ธฐ๋„ ์–ด๋ ต๋‹ค. ๋˜ํ•œ ๊ฐœ๋ฐœํ•˜๋Š” IDEํ™˜๊ฒฝ์—์„œ๋„ ์†์‰ฝ๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์œผ๋ฉฐ, ์‚ฌ๋ฌด์‹ค/์ง‘ ๋“ฑ, ์—ฌ๋Ÿฌ ์žฅ์†Œ์—์„œ ๋™์ผํ•˜๊ฒŒ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ๋„ ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค. (๋ฌผ๋ก  Dropbox)์™€ ๊ฐ™์€ ํด๋ผ์šฐ๋“œ ์„œ๋น„์Šค๋ฅผ ํ™œ์šฉํ•˜๋ฉด ์–ด๋А์ •๋„ ๋‹ค์–‘ํ•œ ํ™˜๊ฒฝ์—์„œ ํ™œ์šฉ๊ฐ€๋Šฅํ•˜์ง€๋งŒ ์ด ๋ฐฉ๋ฒ•์€ ํšŒ์‚ฌ์™€ ๊ฐ™์ด ๋ณด์•ˆ ์ƒ์˜ ์ด์œ ๋กœ ์„œ๋น„์Šค๊ฐ€ ๋ง‰ํ˜€ ์žˆ๋Š” ๊ณณ์—์„œ๋Š” ์ œ๋Œ€๋กœ ์ ์šฉ์ด ๋ถˆ๊ฐ€๋Šฅํ•œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค.

๋งŽ์€ ์›น์‚ฌ์ดํŠธ ์กฐ์‚ฌ๋ฅผ ํ†ตํ•ด ๋‹ค์–‘ํ•œ Snippet๊ด€๋ฆฌ ์„œ๋น„์Šค๋ฅผ ์ฐพ์•„๋ดค์ง€๋งŒ, ๊ทธ ์ค‘์—์„œ ๊ฐœ๋ฐœ์— ๊ฐ€์žฅ ์œ ์šฉํ•œ ๋ฐฉ์‹์€ GitHub์—์„œ ์ œ๊ณตํ•˜๋Š” Gist๋ผ๋Š” ์„œ๋น„์Šค๋ฅผ ์ด์šฉํ•˜๋Š” ๊ฒƒ์ด์—ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๋ณธ ์„ธ์…˜์—์„œ๋Š” Gist๋ฅผ ์ด์šฉํ•œ Snippet๊ด€๋ฆฌ ๋ฐฉ์‹์„ ์•Œ์•„๋ณด๊ณ ์ž ํ•œ๋‹ค. ๋˜ํ•œ ์ตœ๊ทผ ๊ฐ๊ด‘๋ฐ›๊ณ  ์žˆ๋Š” Sublime Text์—์„œ Gistํ”Œ๋Ÿฌ๊ทธ์ธ์„ ํ™œ์šฉํ•˜์—ฌ ์–ด๋–ป๊ฒŒ ํšจ์œจ์ ์œผ๋กœ ๊ฐœ๋ฐœEditor์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š”์ง€๋„ ์•Œ์•„๋ณด๊ณ ์ž ํ•œ๋‹ค.

#Gistํ™˜๊ฒฝ ์…‹ํŒ…

Github ํšŒ์›๊ฐ€์ž…

Gist ์‚ฌ์šฉ์„ ์œ„ํ•ด์„œ๋Š” GitHub ํšŒ์›๊ฐ€์ž…์„ ํ•œ๋‹ค. Github๋Š” ๋งค์šฐ ์œ ๋ช…ํ•˜๊ณ  ๋„๋ฆฌ ํผ์ ธ์žˆ๋Š” ์„œ๋น„์Šค์ด๋ฏ€๋กœ ์„œ๋น„์Šค๊ฐ€ ์ค‘๋‹จ๋  ๊ฑฑ์ •์„ ํ•˜์ง€ ์•Š๊ณ  ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ์™ธ๊ตญ์‚ฌ์ดํŠธ์ด๋‹ˆ๋งŒํผ ํšŒ์›์ •๋ณด๋„ ๊ณผ๋„ํ•˜๊ฒŒ ์š”๊ตฌํ•˜์ง€ ์•Š๋Š”๋‹ค.

Sublime์— Gist ํ”Œ๋Ÿฌ๊ทธ์ธ ์„ค์น˜