Skip to content

Instantly share code, notes, and snippets.

Mike Sherov mikesherov

Block or report user

Report or block mikesherov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mikesherov
mikesherov / gist:65f6e122e5fe2139171c
Created Jul 17, 2014
CSP violation with chrome-extension as source-file
View gist:65f6e122e5fe2139171c
{"document-uri":"https://www.behance.net/joblist","referrer":"https://www.behance.net/Ginz","violated-directive":"img-src https: data: safari-extension: chrome-extension: http://*.rackcdn.com http://huaban.com","original-policy":"connect-src *;frame-src *;img-src https: data: safari-extension: chrome-extension: http://*.rackcdn.com http://huaban.com; report-uri /v2/log/csp","blocked-uri":"http://www.amazon.com","source-file":"chrome-extension://dbpfafcplnjmakknnonpegphpmpmhjhj","line-number":215,"column-number":13,"status-code":0}
@mikesherov
mikesherov / gist:1f38bdc8a499b47dbb40
Created May 21, 2014
Using grasp to upgrade jQuery on your site
View gist:1f38bdc8a499b47dbb40
// converts $.fn.live to $.on
grasp "call[callee.prop=#live][callee.object=call]" -R "\$(document.body).on({{.args:first}}, {{.callee.object.args:first}}, {{.args:last}})"
View gist:5384039
onFocus: function( element, onFocus ) {
var fn = function( event ){
if( !event.originalEvent ) {
return;
}
element.unbind( "focus", fn );
onFocus();
};
element.bind( "focus", fn )[ 0 ].focus();
View gist:5348106
onFocus: function( element, onFocus ) {
element.bind( "focus", function( event ){
if( !event.originalEvent ) {
return;
}
element.unbind( "focus" );
onFocus();
})[ 0 ].focus();
},
@mikesherov
mikesherov / grunt.md
Created Apr 25, 2012
getting grunt to work on windows with cygwin and git
View grunt.md

Getting grunt to work with Cygwin and git on Windows is a bit difficult considering the cygwin package that is installed by git has an outdated version of node running on it (at least that was the case in Windows XP). There are several issues to work through:

  1. Cygwin by default installs an old version of node, this was only the case in my Windows XP machine.
  2. Open Cygwin shell
  3. which node tells you where the executable is
  4. node --version tells you if it's old
  5. cd to the directory listed by which node
  6. mv node.exe node.exe.bak
  7. download node from nodejs.org and install it
  8. Node installed through installer MIGHT not update PATH to point to correct version of node installed normally.
@mikesherov
mikesherov / gist:1465088
Created Dec 12, 2011
jQuery JSHint specific files
View gist:1465088
var jshint = require("./lib/jshint").JSHINT,
reader = require("fs").readFileSync,
files = [
"ajax",
"ajax/jsonp",
"ajax/script",
"ajax/xhr",
"attributes",
"callbacks",
"core",
@mikesherov
mikesherov / LICENSE.txt
Created Jun 7, 2011 — forked from jed/LICENSE.txt
map properties for arrays and objects
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mike Sherov <http://mike.sherov.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@mikesherov
mikesherov / LICENSE.txt
Created Jun 6, 2011 — forked from 140bytes/LICENSE.txt
140byt.es -- bbCodifier
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mike Sherov <http://mike.sherov.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@mikesherov
mikesherov / LICENSE.txt
Created Jun 4, 2011 — forked from bytespider/LICENSE.txt
140byt.es -- convert string to array of UTF-8 bytes
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@mikesherov
mikesherov / LICENSE.txt
Created Jun 4, 2011 — forked from bytespider/LICENSE.txt
140byt.es -- convert string to array of UTF-8 bytes
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
You can’t perform that action at this time.