Skip to content

Instantly share code, notes, and snippets.

@pankaj28843
pankaj28843 / Make soffice command of Libreoffice work on Mac OS X.md
Last active Nov 27, 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
@pankaj28843
pankaj28843 / set_outer_border_for_range_xlsx.py
Last active May 28, 2021
A simple hack - set outer border for a range using xlsxwriter, a Python library
View set_outer_border_for_range_xlsx.py
from __future__ import absolute_import
try:
import cStringIO as StringIO
except ImportError:
import StringIO
# Standard Library
import re
import string
@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
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 xlsx-reader.js
(function(undefined) {
'use strict';
// Check if dependecies are available.
if (typeof XLSX === 'undefined') {
console.log('xlsx.js is required. Get it from https://github.com/SheetJS/js-xlsx');
return;
}
if (typeof _ === 'undefined') {
console.log('Lodash.js is required. Get it from http://lodash.com/');
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 app-services.js
(function(undefined) {
// Get angular app
var app = angular.module("App");
app.factory("XLSXReaderService", ['$q', '$rootScope',
function($q, $rootScope) {
var service = function(data) {
angular.extend(this, data);
};
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: