Skip to content

Instantly share code, notes, and snippets.

View PratikDeoghare's full-sized avatar

Pratik Deoghare PratikDeoghare

View GitHub Profile
@PratikDeoghare
PratikDeoghare / zbell.sh
Created March 24, 2023 16:13 — forked from jpouellet/zbell.sh
Makes Zsh print a bell when long-running commands finish. I use this in combination with i3 and throw big compile jobs (or whatever it may be) into another workspace to get a nice visual notification (workspace indicator turns red) when it's done so I don't need to waste time regularly checking on it.
#!/usr/bin/env zsh
# This script prints a bell character when a command finishes
# if it has been running for longer than $zbell_duration seconds.
# If there are programs that you know run long that you don't
# want to bell after, then add them to $zbell_ignore.
#
# This script uses only zsh builtins so its fast, there's no needless
# forking, and its only dependency is zsh and its standard modules
#
@PratikDeoghare
PratikDeoghare / LICENSE
Created August 1, 2021 19:23 — forked from shaneutt/LICENSE
Golang: Demonstrate creating a CA Certificate, and Creating and Signing Certs with the CA
MIT License
Copyright (c) 2020 Shane Utt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@PratikDeoghare
PratikDeoghare / translate.go
Created July 29, 2021 07:37 — forked from hvoecking/translate.go
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
@PratikDeoghare
PratikDeoghare / install-fonts.txt
Created November 17, 2020 10:53 — forked from matthewhartman/install-fonts.txt
Install TTF Fonts in Debian
cd fonts
mv *.ttf /usr/share/fonts/truetype
cd /usr/share/fonts/truetype
mkfontscale
mkfontdir
fc-cache
xset fp rehash
@PratikDeoghare
PratikDeoghare / ca.md
Created May 18, 2020 15:21 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@PratikDeoghare
PratikDeoghare / dawg.py
Created August 10, 2016 17:49 — forked from smhanov/dawg.py
Use a DAWG as a map
#!/usr/bin/python3
# By Steve Hanov, 2011. Released to the public domain.
# Updated 2014 to use DAWG as a mapping.
import sys
import time
DICTIONARY = "/usr/share/dict/words"
QUERY = sys.argv[1:]
# This class represents a node in the directed acyclic word graph (DAWG). It
@PratikDeoghare
PratikDeoghare / main.cpp
Created August 7, 2016 23:27 — forked from ilyaraz/main.cpp
Cache-aware binary search
#include "timer.h"
#include "random_int.h"
#include <boost/bind.hpp>
#include <boost/foreach.hpp>
#include <algorithm>
#include <iostream>
#include <stdexcept>
#include <vector>
  1. General Background and Overview
  1. General Background and Overview
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->