Skip to content

Instantly share code, notes, and snippets.

@mmuchin
mmuchin / search-git-history.md
Created May 28, 2018 14:31 — forked from lyoshenka/search-git-history.md
Search Git commit history for a string and see the diffs

Searching Git commit history

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

To see the diff of that

@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/
@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 / 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 / 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 / .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 / 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('------------------------------------------');
// 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 / 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}
@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]