Skip to content

Instantly share code, notes, and snippets.

View openhubdev's full-sized avatar

sleepydev openhubdev

  • somewhere in the universe
View GitHub Profile
@openhubdev
openhubdev / git-add-stuff.md
Last active January 21, 2022 12:40
git add . vs git add -A vs git add -u

Summary:

git add -A stages all changes

git add . stages new files and modifications, without deletions (on the current directory and its subdirectories).

git add -u stages modifications and deletions, without new files

//next.config.js
module.exports = {
i18n: {
locales: ['en-US', 'fr', 'ko'], //list of languages
defaultLocale: 'en-US' //set the default language
}
}
//next.config.js
module.exports = {
i18n: {
locales: ['en-US', 'fr', 'ko'],
domains: [
{
domain: 'yourdomain.com',
defaultLocale: 'en-US'
},
{
@openhubdev
openhubdev / .block
Created March 26, 2021 16:56 — forked from d3indepth/.block
Tree layout (from introduction)
license: gpl-3.0
height: 1000
border: no
@openhubdev
openhubdev / .block
Last active March 26, 2021 16:55 — forked from d3indepth/.block
D3 line generator
license: gpl-3.0
height: 120
border: no

🐝 장고 (Django) 101

우선 Python> = 3.3이 설치되어 있는지 확인하십시오.

python -Vor python3 -V

0. 프로젝트 폴더 만들기 (=컨테이너 root)

1. 가상 환경 만들기

그 프로젝트 폴더 안에서 이 명령어 치기:

Django More in-depth

Internationalization:

Once all strings are marked for translation, generate the message files:

Generate message files for a desired language

python manage.py makemessages -l kr

After adding translations to the .po files, compile the messages

🐬 MySQL commands 101

First step

First where your mysql is

which mysql

To login (from unix shell) use -h only if needed.

EXPRESSJS 101

@app.js

Define the custom routes JS files

const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users');
const canvasRouter = require('./routes/canvas');

🐘 Postgres 101

1. Connect to the PostgreSQL

psql postgres or psql postgres -U patrick (as the user "patrick")

2. Create a database

postgres=# CREATE DATABASE djangoblog;

3. Set the access permissions

postgres=> GRANT ALL PRIVILEGES ON DATABASE my_db TO patrick;