Skip to content

Instantly share code, notes, and snippets.


Vishal Telangre vishaltelangre

View GitHub Profile
View base64_encode_decode
base64 original_img.png | base64 --decode > ~/dest/decoded_image.png
View clearfix.css
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* contenteditable attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that are clearfixed.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
vishaltelangre / replace_every_char.jquery.js
Created Apr 8, 2014
Replace every character from a DOM node with desired character
View replace_every_char.jquery.js
function replaceEveryCharOf( selector, withChar, ignoreSpace ) {
$(selector).contents().filter(function() {
return this.nodeType == 3;
var regex = ignoreSpace ? /[^\s.]/g : /./g;
this.textContent = this.textContent.replace(regex, withChar);
// Usage:
vishaltelangre /
Created Apr 9, 2014
Read user input #shell
echo "Do you think I am mad?"
read reply
echo $reply
vishaltelangre / screenMatches.js
Last active Aug 29, 2015
responsive design helper function for javascirpt
View screenMatches.js
* Returns the different properties (Boolean) useful while responsive
* design.
function screenMatches() {
var s = {};
if (window.matchMedia) {
/* Large desktop */
s.largeDesk = window.matchMedia("(min-width: 1200px)").matches;
/* Usual desktop */
vishaltelangre / youtube-dl-aria
Created Apr 14, 2014
aria2 youtube download
View youtube-dl-aria
# aria2c must be installed before moving on
sudo curl -o /usr/local/bin/youtube-dl
sudo chmod a+x /usr/local/bin/youtube-dl
sudo curl -o /usr/local/bin/youtube-dl-aria
sudo chmod a+x /usr/local/bin/youtube-dl-aria
# Usage:
youtube-dl-aria --get-filename -o "%(title)s.%(ext)s" OWHJa0jKJgo
# ^
# |
vishaltelangre / user.behaviors
Last active Aug 29, 2015
LightTable settings backup
View user.behaviors
;; User behaviors
;; -----------------------------
;; Behaviors are stored as a set of diffs that are merged together
;; to create the final set of functionality that makes up Light Table. You can
;; modify these diffs to either add or subtract functionality.
;; Behaviors are added to tags, objects with those tags then automatically gain
;; whatever logic the behavior imparts. To see a list of user-level behaviors,
;; start typing a word related to the functionality you want in between the square
;; brackets (e.g. "theme").
vishaltelangre / uthavdar.tmTheme
Last active Aug 29, 2015
Sublime Text color theme - Uthavdar (उठावदार) [inspired from solarized dark design] #uthavdar
View uthavdar.tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<!-- @author Vishal Telangre -->
<!-- @copyright 2014 -->
<!-- @license MIT -->
<plist version="1.1">
vishaltelangre / Makefile
Created May 15, 2014
go dependency management using vendor dir makefile
View Makefile
GO ?= go
GOPATH := $(CURDIR)/_vendor:$(GOPATH)
all: build
$(GO) build
# reference: