Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am pankaj28843 on github.
  • I am pankaj28843 (https://keybase.io/pankaj28843) on keybase.
  • I have a public key ASBg8_KMmOmISmv0PyeLyy7RHhbIc0CaGf3F1ZTKXTRBEgo

To claim this, I am signing this object:

View famous-people.json
[{"name":"Ada Lovelace","contributions":["First computer program"],"picture":"https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Ada_Lovelace_portrait.jpg/1280px-Ada_Lovelace_portrait.jpg"},{"name":"Grace Hopper","contributions":["A-0 System","COBOL"],"picture":"https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/Commodore_Grace_M._Hopper%2C_USN_%28covered%29.jpg/1920px-Commodore_Grace_M._Hopper%2C_USN_%28covered%29.jpg"},{"name":"Alan Turing","contributions":["Universal Computing Machine","Turing Test","Breaking The Enigma Code"],"picture":"https://upload.wikimedia.org/wikipedia/commons/a/a1/Alan_Turing_Aged_16.jpg"},{"name":"Jessica McKellar","contributions":["Python","Dropbox"],"picture":"https://upload.wikimedia.org/wikipedia/commons/thumb/d/d1/Jessica_McKellar_selfportrait_BW.jpeg/1920px-Jessica_McKellar_selfportrait_BW.jpeg"},{"name":"Karolina Szczur","contributions":["JSConfAU","CSSConfAU"],"picture":"https://avatars0.githubusercontent.com/u/375731?s=460&v=4"},{"name":"John Resig","contrib
View movies.json
[
{
"title": "'71",
"year": 2014,
"rating": 7.2,
"votes": 41702,
"running_times": 5940
},
{
"title": "'A' gai wak",
View create_virtualenv.sh
function create_virtualenv(){
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
project_name=$(basename "$(pwd)");
project_dir=$(pwd);
virtualenv_dir="$HOME/.virtualenvs/$project_name";
virtualenv_dir=${1:-$virtualenv_dir};
View keybase.md

Keybase proof

I hereby claim:

  • I am pankaj28843 on github.
  • I am pankaj28843 (https://keybase.io/pankaj28843) on keybase.
  • I have a public key ASBA0XFJmk0u_zRvHPL7umWltU3U4hEXIJIEmX-q11_u1wo

To claim this, I am signing this object:

View compress_pdf.sh
java -cp /opt/Multivalent.jar tool.pdf.Compress /tmp/5dd69f32-b97b-4f43-9bfa-f182e972f6ef.pdf
@pankaj28843
pankaj28843 / README.md
Last active Aug 29, 2015
Embedding images in tex file as base64 strings?
View README.md

Credits: Based on http://tex.stackexchange.com/a/208824/24794

Compile .tex file using following command:

# Increase buffer size to support large images
# Setting the environment variable to a higher value works here
export buf_size=99999999999
@pankaj28843
pankaj28843 / aes_cipher.py
Created Jul 28, 2015
Encrypt & Decrypt using PyCrypto AES 256
View aes_cipher.py
'''
Based on Stackoverflow Answer: http://stackoverflow.com/a/12525165/353550
'''
import base64
from Crypto.Cipher import AES
from Crypto import Random
BS = 16
@pankaj28843
pankaj28843 / download-national-geographic-photo-of-the-day-in-loop.py
Last active Jun 15, 2020
National Geographic Photo of the Day Wallpaper Changer
View download-national-geographic-photo-of-the-day-in-loop.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import requests
import splinter
import redis
@pankaj28843
pankaj28843 / Make soffice command of Libreoffice work on Mac OS X.md
Last active Sep 15, 2021
Make soffice command of Libreoffice work on Mac OS X
View Make soffice command of Libreoffice work on Mac OS X.md

Quick Start

sudo curl https://gist.githubusercontent.com/pankaj28843/3ad78df6290b5ba931c1/raw/soffice.sh > /usr/local/bin/soffice && sudo chmod +x /usr/local/bin/soffice

Create an bash script at /usr/local/bin/soffice with following content

#!/bin/bash

# Need to do this because symlink won't work