Skip to content

Instantly share code, notes, and snippets.

View potados99's full-sized avatar
🍟
뇸뇸

Potados 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) {