Skip to content

Instantly share code, notes, and snippets.

View sanjaykrishnan's full-sized avatar

sanjay krishnan sanjaykrishnan

  • Sayone Technologies
  • Kerala
View GitHub Profile
@sanjaykrishnan
sanjaykrishnan / gist:3026b9c3c3ded3a8ac1f7c4dd90f7703
Created September 7, 2018 12:01
How to find diff in files in 2 directories
You can use the diff command just as you would use it for files:
diff <directory1> <directory2>
If you want to see subfolders and -files too, you can use the -r option:
diff -r <directory1> <directory2>
sudo -su postgres
psql
create database wynvent;
CREATE USER myuser WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE "wynvent" to myuser;
ALTER USER myuser WITH SUPERUSER;
#quit psql shell
\q
#list all databases
\l
@sanjaykrishnan
sanjaykrishnan / gist:4074324918b89c4bab5644c82246eb39
Created October 8, 2018 04:36
GET parameters in reverse of url.
GET parameters have nothing to do with the URL as returned by reverse. Just add it on at the end:
url = "%s?name=joe" % reverse(viewOne)
@sanjaykrishnan
sanjaykrishnan / except_filtering.py
Created October 15, 2018 04:35
filtering by excluding a type of objects
from myapp.models import Entry
from django.db.models import Q
Entry.objects.filter(~Q(id = 3))
#[<Entry: Entry object>, <Entry: Entry object>, <Entry: Entry object>, ...]
create user fmfb_user with password 'sayone';
create database fmfb_db with owner fmfb_user;
\c fmfb_db
@sanjaykrishnan
sanjaykrishnan / emoji.md
Created November 22, 2018 04:26
adding emoji in html
@sanjaykrishnan
sanjaykrishnan / ssh.md
Last active November 23, 2018 06:17
generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent