Skip to content

Instantly share code, notes, and snippets.

View kshitij10496's full-sized avatar

Kshitij Saraogi kshitij10496

View GitHub Profile
@kshitij10496
kshitij10496 / docker-compose.yml
Created January 17, 2019 15:03
Postgres with Docker example
version: '3'
services:
postgres:
image: postgres:11.1-alpine
container_name: "shadowsDB"
environment:
- POSTGRES_USER="batman"
- POSTGRES_PASSWORD="blueflower"
- POSTGRES_DB="league_of_shadows"
@kshitij10496
kshitij10496 / authors.sh
Created October 23, 2018 20:32
Shell command to create a list of all the authors of a Git repository
# You can add this to your Makefile to make it easy to update authors.
# Let's be thankful to the community and show our gratitude. :D
git log --pretty="%an <%ae>" | sort | uniq >> AUTHORS
@kshitij10496
kshitij10496 / config.toml
Created September 11, 2018 18:11
Simple Hugo configuration file
# Hostname (and path) to the root.
baseURL = "https://<your-github-username>.github.io/"
# The site’s language code used to generate RSS.
languageCode = "en"
# Theme to use (located by default in /themes/THEMENAME/).
theme = "<your-theme-name>"
# Site title.
@kshitij10496
kshitij10496 / deploy.sh
Last active September 11, 2018 13:42
Shell script for deploying Hugo blog to GitHub
#!/bin/sh
hugo
cd public
git add .
git commit -m "$1"
git push origin master
@kshitij10496
kshitij10496 / SketchSystems.spec
Created June 9, 2018 11:59
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second State
Second State
@kshitij10496
kshitij10496 / logging.md
Created May 30, 2018 17:20
Logging in Go

Printing log message and/or writing log libraries is relatively easy, maintaining the logging infrastructure is a complex task.

What should we log?

  • Everything which is essential to understand our application's behaviour.
  • Logging can be a bottleneck to performance-centric APIs.

Guideline

  • Use log.Criticalf explicitly in the business logic layer only.
  • Use log.Debugf in the controllers/handlers whenever you want to.
@kshitij10496
kshitij10496 / osdesign.c
Created January 31, 2018 09:11
OSDesign
#include<stdio.h>
#include<string.h>
#include<time.h>
int main() {
char x[20];
int a[200];
do {
scanf("%s", x);
@kshitij10496
kshitij10496 / subl_config
Created January 29, 2018 13:34
Sublime Text 3 Material Design Configurations
{
"auto_complete_delay": 5,
"auto_complete_selector": "source, text",
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"create_window_at_startup": false,
"default_line_ending": "unix",
"folder_exclude_patterns":
[
".svn",
".git",
@kshitij10496
kshitij10496 / feynmanize.py
Created December 8, 2017 19:23
Script to print random quotes from/on Richard Feynman
#!env/bin/python3
# encoding: utf-8
"""
This scripts prints a random quote from WikiQuote page of Richard Feynman.
$ python3 feynmanize.py
!!! FEYMANIZE !!!
================================================================================
@kshitij10496
kshitij10496 / bob_superhero.vb
Last active November 12, 2017 15:51
BASIC program as written by Bob "Superhero" Newby in Stranger Things S02E08
DIM FourDigitPassword INTEGER
FOR i = 0 TO 9
FOR j = 0 TO 9
FOR k = 0 TO 9
FOR l = 0 TO 9
FourDigitPassword = getFourDigits (i,j,k,l)
IF checkPasswordMatch(FourDigitPassword) = TRUE THEN
GOTO 140
END
NEXT l