Skip to content

Instantly share code, notes, and snippets.

View potados99's full-sized avatar
๐Ÿซ 
์—ฆํšจ

์†ก๋ณ‘์ค€ potados99

๐Ÿซ 
์—ฆํšจ
View GitHub Profile
@potados99
potados99 / gist-instruction.md
Last active June 29, 2019 17:01
How to use Gist
@potados99
potados99 / resize.sh
Created June 30, 2019 08:57
Setting prompt size
#!/bin/sh
stty cols 200 rows 50
@potados99
potados99 / jekyll-code-block-escape.md
Last active July 9, 2019 20:02
Escape {% in Jekyll code block

Place {% raw %} and {% endraw %} pair.

{% raw $}
```
{{% site.data...blah %}}
```
{% endraw %}
@potados99
potados99 / node-and-es6.md
Created March 5, 2020 17:10
Node.js v12 + ECMA Module

Enable ES module support

Built-in way

Use --experimental-modules.

For example:

node --experimental-modules index.js
@potados99
potados99 / disable-autolinking.md
Created June 30, 2020 12:06 — forked from alexpeattie/disable-autolinking.md
Disable Github-flavored Markdown autolinking

http://example.com

http://example.com

@potados99
potados99 / commit-n-days-before.sh
Last active June 30, 2020 14:44
Create a commit at N days before
#!/bin/zsh
# Commit N days before
# At least one arg needed.
if [ $# -lt 1 ]; then
echo "Usage: ./commit-n-days-before [N]"
exit 1
fi

๋ฐฑ์—…

$ mysqldump -u [์‚ฌ์šฉ์ž ๊ณ„์ •] -p [ํŒจ์Šค์›Œ๋“œ] --no-tablespaces --column-statistics=0 [์›๋ณธ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ช…] > [์ƒ์„ฑํ•  ๋ฐฑ์—… DB๋ช…].sql
$ mysqldump -u potados -p 1234 --no-tablespaces --column-statistics=0 cafeteria > backedup.sql

mysqldump 8๋ถ€ํ„ฐ --no-tablespaces --column-statistics=0 ์˜ต์…˜์„ ์ฃผ์–ด์•ผ ํ•จ.

๋ณต์›

$ mysql -u [์‚ฌ์šฉ์ž ๊ณ„์ •] -p [ํŒจ์Šค์›Œ๋“œ] [๋ณต์›ํ•  DB] < [๋ฐฑ์—…๋œ DB].sql
@potados99
potados99 / install-npm-module-globally
Last active December 3, 2020 09:09
npm ์ „์—ญ ๋ชจ๋“ˆ ์„ค์น˜ํ•˜๊ธฐ
sudo npm install -g --unsafe-perm [module]
@potados99
potados99 / easy_pi.c
Last active January 24, 2021 19:12
Obfuscated pi.c explained
// See https://www.cise.ufl.edu/~manuel/obfuscate/pi.c
#include <stdio.h>
// Increase area for 1.
// If heading unary operator '-' does not exist, increase dia for 1.
#define _ (area++) < 0 ? 0 : dia++;
long area = 0;
long dia = 0;
@potados99
potados99 / main.c
Created March 5, 2021 19:08
C ๋ฌธ์ž์—ด ์ž๋ฅด๊ธฐ
/**
* ์ŠคํŠธ๋ง์„ delimiter๋กœ ์ž๋ฆ…๋‹ˆ๋‹ค.
* strtok์™€ ๋น„์Šทํ•˜๊ฒŒ ์›€์ง์ž…๋‹ˆ๋‹ค.
*
* @param source ์›๋ณธ ์ŠคํŠธ๋ง. ์›๋ณธ์— ์ˆ˜์ •์„ ๊ฐ€ํ•˜๋‹ˆ ์ฃผ์˜!
* @param delimiter ์ž๋ฅผ ๊ธฐ์ค€์ด ๋˜๋Š” ๋ฌธ์ž.
* @return ์ž˜๋ฆฐ ์กฐ๊ฐ ์ŠคํŠธ๋ง์˜ ์‹œ์ž‘ ์œ„์น˜.
*/
char *splitNext(char **source, char delimiter) {
if (!**source) {