Skip to content

Instantly share code, notes, and snippets.

View arpanpal010's full-sized avatar
🏠
Working from home

Arpan Pal arpanpal010

🏠
Working from home
View GitHub Profile
@arpanpal010
arpanpal010 / libnotify-skype.sh
Created November 25, 2015 12:22
Skype notification handler, executes libnotify commands on skype events using notify-send
#!/bin/sh
# all variables found so far
# execute the below line for all events
# ~/bin/libnotify-skype.sh "%type" "%sname" "%sskype" "%smessage" "%fpath" "%fname" "%fsize" "%fprogress" "%fspeed"
# below line prints all the param values on any event
# notify-send "$1 $2 $3 $4 $5 $6 $7 $8 $9";
# shorthand for notification
notif () {
@arpanpal010
arpanpal010 / ctags definitions for Javascript
Created December 8, 2015 16:36 — forked from tim-smart/ctags definitions for Javascript
CTags Definitions for Javascript
--langdef=js
--langmap=js:.js
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\{/\5/,object/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\5/,function/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\[/\5/,array/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[^"]'[^']*/\5/,string/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*(true|false)/\5/,boolean/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[0-9]+/\5/,number/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*.+([,;=]|$)/\5/,variable/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*[ \t]*([,;]|$)/\5/,variable/
#!/bin/sh
# System Update
pacman --noconfirm -Syu
#The essentials
pacman --noconfirm -S base-devel vim git
# Packer (AUR Helper)
cd /tmp
@arpanpal010
arpanpal010 / ytp.sh
Last active May 18, 2016 17:02
Youtube player for raspberry pi. Using pip version of Youtube-DL and omxplayer that comes default in Raspbian.
#!/bin/bash
# youtube url player for raspberry pi,
# ------------------------------------------------------------------
ytdlCmd="youtube-dl";
ytdlArgs="-f 140 --prefer-ffmpeg -g"; # 141 - 256k audio, 140 - 128k audio, 22 - best quality available
playerCmd="omxplayer";
playerArgs="--vol -300";
@arpanpal010
arpanpal010 / cache-service.ts
Created October 19, 2017 14:37
A generic caching mechanism that stores in localstorage.
export static class CacheService {
// static $inject = ["localStorageService", "$rootScope", "$timeout"]
private static ls : localStorageService = undefined; // wrap localstorage to hide data
private static instance : CacheService = undefined;
private callables : Object = {};
private asyncCallables : Object = {};
constructor(ls : any, rootScope : any, timeout : any) {
if(!this.instance) {