Skip to content

Instantly share code, notes, and snippets.

View pankaj28843's full-sized avatar

Pankaj Kumar Singh pankaj28843

View GitHub Profile
@pankaj28843
pankaj28843 / Make soffice command of Libreoffice work on Mac OS X.md
Last active February 12, 2025 06:47
Make soffice command of Libreoffice work on Mac OS X

Deprecated Notice

This script, originally created on April 29, 2015, addressed a different behavior of LibreOffice installation on macOS at that time. However, it is now outdated and no longer relevant. Please refer to the latest comments for updated information, as much has changed over the past 8–9 years.


Quick Start

sudo curl https://gist.githubusercontent.com/pankaj28843/3ad78df6290b5ba931c1/raw/soffice.sh > /usr/local/bin/soffice && sudo chmod +x /usr/local/bin/soffice
@pankaj28843
pankaj28843 / xvfb.sh
Created February 11, 2015 07:44
Run xvfb on display 99 as a service
#!/bin/bash
# Description: Starts xvfb on display 99
if [ -z "$1" ]; then
echo "`basename $0` {start|stop}"
exit
fi
case "$1" in
@pankaj28843
pankaj28843 / low-battery-notification.sh
Last active August 29, 2015 14:14
Sends a notification if laptop battery is lower than a minimum level
#!/bin/sh
while true;
do
# Minimum battery level in percentage.
# If remaning battery percentage is less than this then a notification will be shown.
MINIMUM_LEVEL=50;
# Determine battery status
BATTERY_STATUS=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state" | sed -E 's/state://' | sed 's/^[ \t]*//;s/[ \t]*$//');
@pankaj28843
pankaj28843 / price_alert_flipkart.py
Created December 18, 2014 10:51
price alert flipkart
#!/usr/bin/python2.7
import re
import requests
from envelopes import Envelope, SMTP
from lxml import etree
from splinter import Browser
REGEX_FIND_NUMBER = re.compile(r'\d*\.\d+|\d+')
@pankaj28843
pankaj28843 / README.md
Created November 13, 2014 07:55
Get links shared by someone on Twitter in your Pocket App
@pankaj28843
pankaj28843 / extract_links_from_a_tweet.py
Created November 10, 2014 04:47
Extract Links for a particular Tweet, given absolute URL
@pankaj28843
pankaj28843 / README.md
Last active August 29, 2015 14:09
MATLAB R2014a Desktop Shortcut

Run following command:

curl https://gist.githubusercontent.com/psjinx/526f32b69c0655624b87/raw/setup.sh | sh
# Standard Library
import multiprocessing
DEFAULT_PROCESSES_COUNT = int(round(1.5 * multiprocessing.cpu_count()))
def spawn(f):
def fun(q_in, q_out):
while True:
i, x = q_in.get()
import re
import requests
from lxml import etree
REGEX_FIND_NUMBER = re.compile(r'\d*\.\d+|\d+')
REGEX_FIND_COMMA = re.compile(r'\s*,\s*')
def get_price_from_text(text):
@pankaj28843
pankaj28843 / set_outer_border_for_range_xlsx.py
Last active September 1, 2022 21:48
A simple hack - set outer border for a range using xlsxwriter, a Python library
from __future__ import absolute_import
try:
import cStringIO as StringIO
except ImportError:
import StringIO
# Standard Library
import re
import string