Skip to content

Instantly share code, notes, and snippets.

@mmuchin
mmuchin / spacer.less
Created March 7, 2012 17:49
LESS: spacer
/**
* Spacing classes
* Should be used to modify the default spacing between objects (not between nodes of the same object)
* Please use judiciously. You want to be using defaults most of the time, these are exceptions!
* <type><location><size>
*/
/* ====== Default spacing ====== */
/* h1, h2, h3, h4, h5, h6, ul, ol,dl, p,blockquote, .media {margin:10px;}
h1, h2, h3, h4, h5, h6,img{padding-bottom:0px;}
@mmuchin
mmuchin / gist:2367094
Created April 12, 2012 13:07
BOOTSTRAP:Thumbnails
ul.thumbnails>li.span3>a[href=#].thumbnail>img[src=http://placehold.it/260x180][alt=Title]
@mmuchin
mmuchin / gist:2382121
Created April 14, 2012 04:21
BOOTSTRAP: Form Control Group
div.control-group>label.control-label[for=input01]{Text input}+div.controls>input[type=text].span2+p.help-block{Supporting help text}
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
@mmuchin
mmuchin / chrome-compare-script
Created October 19, 2012 01:32
Chrome script to compare two elements values
(function(a,b){
var aComputed = getComputedStyle(a);
var bComputed = getComputedStyle(b);
console.log('------------------------------------------');
console.log('You are comparing: ');
console.log('A:', a);
console.log('B:', b);
console.log('------------------------------------------');
@mmuchin
mmuchin / .jshintrc
Last active December 16, 2015 18:09
jshint settings file.
{
"asi" : false,
"boss": true,
"browser": true,
"curly": true,
"debug" : false,
"devel" : false,
"eqeqeq": true,
"eqnull": true,
"es5" : false,
@mmuchin
mmuchin / 0_reuse_code.js
Created January 27, 2014 17:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mmuchin
mmuchin / angularjs_directive_attribute_explanation.md
Created June 27, 2016 23:24 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@mmuchin
mmuchin / introrx.md
Created August 19, 2016 14:39 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@mmuchin
mmuchin / cmd.sh
Created December 20, 2017 23:05 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/