Skip to content

Instantly share code, notes, and snippets.

View abhishekkr's full-sized avatar
:octocat:
update your licenses

AbhishekKr abhishekkr

:octocat:
update your licenses
View GitHub Profile
@abhishekkr
abhishekkr / git-new
Last active February 20, 2024 17:24
git-new: new Git Repo with custom content
#!/usr/bin/env bash
git-ignore(){
if [[ $# -eq 0 ]]; then
cat >> ./.gitignore << GITIGNORE
*swn
*swo
*swp
*~
*.tmp
@abhishekkr
abhishekkr / first-two-byte-toggler.py
Created November 9, 2023 20:12
To toggle first two bytes of any file, quickly
#!/usr/bin/env python3
"""
Toggle the first & second bytes.
Syntax: python <py-file> filename
"""
import sys
@abhishekkr
abhishekkr / What-To-Play-First-For-Disk-Space.py
Created July 4, 2023 21:17
What-To-Play-First-For-Disk-Space
#!/usr/bin/env python2
"""
What-To-Play-First-For-Disk-Space
Requirements:
* Python (https://en.wikipedia.org/wiki/Python_(programming_language))
* FFMPEG (https://en.wikipedia.org/wiki/FFmpeg)
This utility helps with two problems:
* Need to empty some disk-space quickly but have lots of videos/podcasts on it yet to finish.
@abhishekkr
abhishekkr / delete-from-filters
Created February 26, 2022 18:18
gmail-helper gists
filters_to_delete:
- "to:(lists.launchpad.net)"
- "from:(@bewakoof.net)"
- "from:(chtah.net)"
- "from:(@daniwebmail.com)"
- "from:(@dzone.com)"
- "from:(ecast@opensystemsmedia.com)"
- "from:(@eletters.whatsnewnow.com)"
- "from:(email@engage.redhat.com)"
- "from:(@email.udemy.com)"
// increase width for side-bar of threads to say 700px
$("#col_flex").css('flex-basis', '700px');
@abhishekkr
abhishekkr / drop-a-bomb.js
Last active February 27, 2019 23:13
webaudio js samples
{ctx = new AudioContext();
t = {b: ctx.currentTime};
o = ctx.createOscillator();
o.connect(ctx.destination);
o.frequency.value = 500;
o.frequency.exponentialRampToValueAtTime(166,t.b+5);
o.start(t.b);
o.stop(t.b+5);}
@abhishekkr
abhishekkr / node-version
Created August 26, 2017 21:07
easy version manager for nodejs
#!/usr/bin/env bash
set -e
[[ ! -z "$1" ]] && export LOCAL_BIN="$1"
[[ -z "${LOCAL_BIN}" ]] && export LOCAL_BIN="${HOME}/bin"
[[ ! -d "${LOCAL_BIN}" ]] && mkdir -p "${LOCAL_BIN}"
[[ -z "${NODEJSVERSION}" ]] && export NODEJSVERSION="6.11.2"
[[ -z "${NODEJSOS}" ]] && export NODEJSOS="linux"
@abhishekkr
abhishekkr / go-versions
Last active November 12, 2019 14:13
easy version manager for golang, default at `~/bin` for `v1.13.4`
#!/usr/bin/env bash
### usage example:$ go-versions 1.13.4
set -e
export GOVERSION="$1"
[[ ! -z "$2" ]] && export LOCAL_BIN="$2"
[[ -z "${LOCAL_BIN}" ]] && export LOCAL_BIN="${HOME}/bin"
[[ ! -d "${LOCAL_BIN}" ]] && mkdir -p "${LOCAL_BIN}"
@abhishekkr
abhishekkr / go-tasks
Last active December 30, 2017 23:47
golang dependency and other tasks manager (stupid and homegrown, does basic job)
#!/bin/bash
#############################################################################
#
# You don't need to keep your project in GOPATH go-get dir.
# Keep your project in your normal workspace as projects on other stacks.
# This works like virtualenv, will create a local GOPATH and manage it's own via Linux's symlinks magic.
#
# 'source go-tasks'
# source this file to load all methods
# it turns on the go environment for the path it's run from
@abhishekkr
abhishekkr / mdbm.quicksetup.rhel6BaseDistros.sh
Created December 27, 2014 05:09
MDBM workspace quick-setup helper
#!/usr/bin/env bash
set -e
#####
# MDBM workspace quick-setup helper
#####
GARAGE_BASEDIR="/tmp/mdbm-garage"
MDBM_BASEDIRNAME="github-yahoo-mdbm"
MDBM_GITURI="https://github.com/yahoo/mdbm"