Skip to content

Instantly share code, notes, and snippets.

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

Vinay Aggarwal vinaydotblog

🏠
Working from home
View GitHub Profile
@vinaydotblog
vinaydotblog / composelist.sh
Created June 28, 2018 16:29 — forked from mortenson/composelist.sh
List all Docker Compose projects currently running
#!/bin/bash
docker ps --filter "label=com.docker.compose.project" -q | xargs docker inspect --format='{{index .Config.Labels "com.docker.compose.project"}}'| uniq
@vinaydotblog
vinaydotblog / composer.json
Created July 23, 2017 11:24 — forked from andyshinn/composer.json
Docker Compose PHP Composer Example
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}
@vinaydotblog
vinaydotblog / dump_scopes.py
Created September 17, 2016 21:10 — forked from sessa/dump_scopes.py
Dump scopes used by a TextMate grammar
#!/usr/bin/env python
import plistlib
class Grammar(object):
def __init__(self, grammar):
self._grammar = grammar
self.names = []
self.includes = []
/*
* $(elems).appear(function(elem){
* console.log("Reached elment", elem);
* });
*/
$.fn.appear = function(cb) {
var w_height = $(window).height();
#BECOME SUPER USER#
sudo -i
#add sublime to repository#
add-apt-repository ppa:webupd8team/sublime-text-2
#update#
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
<h1>Flickr Loading Animation</h1>
<div class="loader">
<i class="dot-pink"></i>
<i class="dot-blue"></i>
</div>
<p>…as seen in the new Flickr iOS app.</p>
@vinaydotblog
vinaydotblog / github_tree_slider.js
Created October 20, 2012 07:14 — forked from ryanb/github_tree_slider.js
This is how GitHub's new AJAX file browser works.
GitHub.TreeSlider = function () {
if (window.history && window.history.pushState) {
function a() {
if (e.sliding) {
e.sliding = false;
$(".frame-right").hide();
$(".frame-loading:visible").removeClass("frame-loading")
}
}
if (!($("#slider").length == 0 || !GitHub.shouldSlide)) if (!navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
@vinaydotblog
vinaydotblog / gist:2700636
Created May 15, 2012 10:23 — forked from paulirish/gist:373253
jquery invert
// jquery invert plugin
// by paul irish
// some (bad) code from this css color inverter
// http://plugins.jquery.com/project/invert-color
// some better code via Opera to inverse images via canvas
// http://dev.opera.com/articles/view/html-5-canvas-the-basics/#insertingimages
// and some imagesLoaded stuff from me
// http://gist.github.com/268257
// usage: log('inside coolFunc',this,arguments);
// http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
}
};