— Clone repository with submodules automatically:
git clone --recursive [email protected]:name/repo.git
— Initialize submodules after regular cloning:
| # SCALA | |
| scala> val fs = List(1, 2, 3).map(i => () => i) | |
| val fs: List[() => Int] = List($Lambda$2341/0x00000008408e7c40@64518270, $Lambda$2341/0x00000008408e7c40@3b7c58e7, $Lambda$2341/0x00000008408e7c40@79627d27) | |
| scala> fs.foreach(x => println(x())) | |
| 1 | |
| 2 |
| select | |
| cl2.relname as child_table, | |
| att2.attname as "child_column", | |
| cl.relname as "parent_table", | |
| att.attname as "parent_column", | |
| conname, | |
| 'alter table ' || cl2.relname || ' drop constraint ' || conname || ';' as drop_stmt, | |
| 'alter table ' || cl2.relname || ' add constraint ' || conname | |
| || ' foreign key (' || att2.attname || ') references ' || cl.relname | |
| || ' on update cascade deferrable initially deferred;' as create_stmt |
— Clone repository with submodules automatically:
git clone --recursive [email protected]:name/repo.git
— Initialize submodules after regular cloning:
| sudo apt-get update | |
| sudo apt-get install kdiff3 | |
| git config --global --add merge.tool kdiff3 | |
| git config --global --add mergetool.kdiff3.path "/usr/bin/kdiff3" | |
| git config --global --add mergetool.kdiff3.trustExitCode false | |
| git config --global --add mergetool.prompt false | |
| git config --global --add diff.guitool kdiff3 | |
| git config --global --add difftool.kdiff3.path "/usr/bin/kdiff3" |
| #!/bin/bash | |
| db_name="$1" | |
| if [ -z "$db_name" ]; then | |
| echo "Usage: $0 <db_name or uri>" | |
| exit 1 | |
| else | |
| echo "Collections in db: $db_name." |
| -- analyze DB for more precise stats | |
| VACUUM (FULL, ANALYZE); | |
| -- get row counts for all tables (option 1) | |
| SELECT | |
| nspname AS schemaname,relname,reltuples | |
| FROM pg_class C | |
| LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) | |
| WHERE | |
| nspname NOT IN ('pg_catalog', 'information_schema') AND |
Hopefully this will answer "How do I setup or start a Django project using REST Framework and ReactJS?"
This is a guide to show you step by step how this can be setup. If you just want to get started, use the cookiecuter I set up cookiecutter-django-reactjs. It basically is a fork of pydanny's cookiecutter, just added the front-end stuff :).
I created this because it was SUCH a pain in the ass setting up a project using all the latest technologies. After some research, I figured it out and have it working. The repo that implements this is located here. Feel free to use it as a boilerplate ;)
Main features:
| #!/bin/bash | |
| for t in $(echo '\dt' | psql "$1" | cut -d '|' -f 2 | egrep -v 'List|Name|--|\(') | |
| do echo "TABLE: $t" | |
| echo "\d $t" | psql "$1" | grep '|' | egrep -v Column | cut -d '|' -f 1 | |
| echo | |
| done |
| var cols = db.getCollectionNames(); | |
| cols.forEach(x => { | |
| var res = db[x].find({}).sort({_id: -1}).limit(3); | |
| print(x + ": "); | |
| res.forEach(x => print(x._id + " is " + x._id.getTimestamp())); | |
| print(); | |
| } | |
| ); |
| ffprobe -hide_banner -loglevel fatal -show_error -show_format -show_streams -show_programs -show_chapters -show_private_data -print_format json some.mp4 | |
| { | |
| "programs": [ | |
| ], | |
| "streams": [ | |
| { | |
| "index": 0, | |
| "codec_name": "h264", |