Skip to content

Instantly share code, notes, and snippets.

Avatar

Vishal Telangre vishaltelangre

View GitHub Profile
View base64_encode_decode
base64 original_img.png | base64 --decode > ~/dest/decoded_image.png
View clearfix.css
/**
* CLEARFIX
*
* 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
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;
}).each(function(){
var regex = ignoreSpace ? /[^\s.]/g : /./g;
this.textContent = this.textContent.replace(regex, withChar);
});
}
// Usage:
@vishaltelangre
vishaltelangre / read_input.sh
Created Apr 9, 2014
Read user input #shell
View read_input.sh
echo "Do you think I am mad?"
read reply
echo $reply
@vishaltelangre
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
vishaltelangre / youtube-dl-aria
Created Apr 14, 2014
aria2 youtube download
View youtube-dl-aria
# aria2c must be installed before moving on
sudo curl https://yt-dl.org/downloads/2014.04.04.2/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+x /usr/local/bin/youtube-dl
sudo curl https://raw.githubusercontent.com/tobbez/youtube-dl-aria/master/youtube-dl-aria -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
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
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" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- @author Vishal Telangre -->
<!-- @copyright 2014 -->
<!-- @license MIT -->
<plist version="1.1">
<dict>
<key>name</key>
<string>Uthavdar</string>
<key>semanticClass</key>
@vishaltelangre
vishaltelangre / Makefile
Created May 15, 2014
go dependency management using vendor dir makefile
View Makefile
GO ?= go
GOPATH := $(CURDIR)/_vendor:$(GOPATH)
all: build
build:
$(GO) build
# reference: http://peter.bourgon.org/go-in-production/
You can’t perform that action at this time.