Skip to content

Instantly share code, notes, and snippets.

View kishvanchee's full-sized avatar

Kishore Vancheeshwaran kishvanchee

View GitHub Profile
@kishvanchee
kishvanchee / venv_activate_this.py
Created February 19, 2020 11:02 — forked from nackjicholson/venv_activate_this.py
A script for loading the activate_this.py into a non `virtualenv` virtual env like `poetry` or `python -m venv`.
import argparse
import base64
import os
import zlib
from pathlib import Path
def convert(s):
b = base64.b64decode(s.encode('ascii'))
return zlib.decompress(b).decode('utf-8')
@kishvanchee
kishvanchee / Makefile
Created March 20, 2020 08:36 — forked from kristopherjohnson/Makefile
Makefile that uses Pandoc to generate HTML, PDF, DOCX, etc. from Markdown source files
# Makefile
#
# Converts Markdown to other formats (HTML, PDF, DOCX, RTF, ODT, EPUB) using Pandoc
# <http://johnmacfarlane.net/pandoc/>
#
# Run "make" (or "make all") to convert to all other formats
#
# Run "make clean" to delete converted files
# Convert all files in this directory that have a .md suffix
@kishvanchee
kishvanchee / JitBitSQLAnswers.sql
Created April 2, 2021 09:14 — forked from rsepassi/JitBitSQLAnswers.sql
JitBit SQL Interview Questions Answered
-- JitBit SQL Interview Questions (Posted on Hacker News)
-- http://www.jitbit.com/news/181-jitbits-sql-interview-questions/?utm_source=hackernewsletter&utm_medium=email
-- Schema:
-- employees table
-- EmployeeID
-- DepartmentID
-- BossID
-- Name
-- Salary
@kishvanchee
kishvanchee / 1 - sql_interview_questions.md
Created April 2, 2021 09:14 — forked from mjhea0/1 - sql_interview_questions.md
Jitbit's SQL interview questions
@kishvanchee
kishvanchee / postgres-cheatsheet.md
Created April 3, 2021 19:10 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)