Skip to content

Instantly share code, notes, and snippets.

View navinpai's full-sized avatar

Navin Pai navinpai

View GitHub Profile
@navinpai
navinpai / navin-bunsenlabs-default.conkyrc
Created November 9, 2022 20:01
Config for Conky | BunsenLabs Beryllium
conky.config = {
-- Begin Window Settings
own_window = true,
own_window_type = 'desktop',
own_window_transparent = false,
own_window_hints = 'undecorated,below,skip_taskbar,skip_pager,sticky',
own_window_colour = '000000',
own_window_class = 'Conky',
own_window_title = 'Bunsen Labs Default Right Conky',
@navinpai
navinpai / .tmux.conf
Last active April 13, 2020 11:46
India Corona Stats Tmux Conf
# Note: This assumes `jq` is already installed. Use `brew install jq` on OSX
# Add this to `~/.tmux.conf` to get Corona Stats in yout Tmux status bar
# Example of how this looks: https://imgur.com/hXrV5Nw (This is on OSX with iTerm)
set -g status-right "#[fg=#ffffff,bg=#ff0000,bold] #(curl -s https://api.covid19india.org/data.json -H 'Cache-Control: no-cache' | jq -r '. | .statewise[0].confirmed + \" (+\" + .statewise[0].deltaconfirmed + \")\"') "
# Interval to refresh data at
set -g status-interval 180
@navinpai
navinpai / detect-private-browsing.js
Created April 8, 2018 08:12 — forked from cou929/detect-private-browsing.js
Detect private browsing mode (InPrivate Browsing or Incognito).
function retry(isDone, next) {
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false;
var id = window.setInterval(
function() {
if (isDone()) {
window.clearInterval(id);
next(is_timeout);
}
if (current_trial++ > max_retry) {
window.clearInterval(id);
@navinpai
navinpai / styles.json
Last active December 21, 2017 18:02
CSS Samples JSON
{
"No Theme": {
"template": "###REPLY###",
"css": "{}"
},
"Welcome Theme": {
"template": "<body><img src=\"https://i.imgur.com/oUSDFaE.jpg\"><p>###REPLY###</p><div style=\"text-align:center; font-size 8px; color: #cccccc \"Copyright BigCorp 2017</div></body>",
"css": "{ \"body\" : \"color: #0000ff; font-size: 16px\" }"
},
"Error Theme": {
@navinpai
navinpai / iiitb_prime.txt
Created September 11, 2017 20:33
IIIT-B Prime
1111111111111111111111111111111111111111111111111111111111111111111
1111111111119991099111111111111111111111111111111111111111111111111
1111111110000001000009911111111111111111111111111111111111111111111
1111111190000001000000991111111111111111111111111111111111111111111
1111119000000001000000000611111111111111111111111111111111111111111
1111100000000001000000000961111111111111111111111111111111111111111
1111119000000001000000000911111111111111111111111111111111111111111
1111991100000001000000091190111111111111111111111111111111111111111
1119000011990091090009111900911111111111111111111111111111111111111
1110000099011166161116000000011111111111111111111111111111111111111
@navinpai
navinpai / build.js.map
Created August 31, 2017 18:53
Build File Map
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///build.js","webpack:///webpack/bootstrap a1d700d176e5b8233432","webpack:///./~/core-js/library/modules/_core.js","webpack:///./~/core-js/library/modules/_wks.js","webpack:///./~/core-js/library/modules/_global.js","webpack:///./~/core-js/library/modules/_object-dp.js","webpack:///./~/core-js/library/modules/_descriptors.js","webpack:///./~/core-js/library/modules/_export.js","webpack:///./~/core-js/library/modules/_has.js","webpack:///./~/core-js/library/modules/_an-object.js","webpack:///./~/core-js/library/modules/_hide.js","webpack:///./~/core-js/library/modules/_to-iobject.js","webpack:///./~/core-js/library/modules/_fails.js","webpack:///./~/core-js/library/modules/_is-object.js","webpack:///./~/core-js/library/modules/_iterators.js","webpack:///./~/core-js/library/modules/_property-desc.js","webpack:///./~/core-js/library/modules/_uid.js","webpack:///./~/core-js/library/modules/_cof.js","webpack:///./~/core-js/library/modu
@navinpai
navinpai / build.js
Created August 31, 2017 18:47
VueJS Fileuploader Build
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("axios")):"function"==typeof define&&define.amd?define(["axios"],t):"object"==typeof exports?exports["vuejs-uploader"]=t(require("axios")):e["vuejs-uploader"]=t(e.axios)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=103)}([function(e,t){var n=e.exports={version:"2.5.1"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(25)("wks"),o=n(14),i=n(2).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},
@navinpai
navinpai / commit.py
Created January 6, 2017 18:43
Add Commit via PyGithub
import github
g = github.Github("username", "password")
repo = g.get_repo('username/reponame')
head_ref = repo.get_git_ref("heads/master")
latest_commit = gh_repo.get_git_commit(head_ref.object.sha)
base_tree = latest_commit.tree
new_tree = repo.create_git_tree([github.InputGitTreeElement(path="filename",mode='100644',type='blob',content="filecontent")],base_tree)
new_commit = repo.create_git_commit(message="commit message",parents=[latest_commit],tree=new_tree)
head_ref.edit(sha=new_commit.sha, force=False)
@navinpai
navinpai / Android.mk
Last active September 23, 2016 22:13
JNI files Android
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_CAMERA_MODULES:=on
OPENCV_INSTALL_MODULES:=on
OPENCV_LIB_TYPE:=SHARED
include <PATH to opencv for android SDK>/sdk/native/jni/OpenCV.mk
LOCAL_MODULE := native-lib
@navinpai
navinpai / build.gradle
Created September 23, 2016 21:54
build.gradle with custom ndkBuild task
sourceSets.main {
jni.srcDirs = [] //disable automatic ndk-build call
jniLibs.srcDir 'src/main/jni'
}
task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
commandLine "<path to your ndk>/ndk-build",
'NDK_PROJECT_PATH=build/intermediates/ndk',
'NDK_LIBS_OUT=src/main/jniLibs',
'APP_BUILD_SCRIPT=src/main/jni/Android.mk',