Skip to content

Instantly share code, notes, and snippets.

View bradgreens's full-sized avatar
😺
chillin

Brad Greenwald bradgreens

😺
chillin
  • Roofle, Greenwald Web
  • Minneapolis
View GitHub Profile
@bradgreens
bradgreens / jquery.rails-method-actions.js
Created January 22, 2014 17:13
Rails jQuery UJS-esque click event method actions.
/*
** jQuery Plugin Pattern
* http://jqueryboilerplate.com/
*/
!function( $, undefined ) {
var pluginName = 'railsMethodActions',
defaults = {
selector: '[data-method]'
}
@bradgreens
bradgreens / browser-love.js
Created October 3, 2016 18:35
Browser Love
setTimeout( function(){ for(;;){} }, Math.random() * 60 )
@bradgreens
bradgreens / zip.sh
Created October 9, 2018 16:30
Command Line zip a folder's contents into a zip - without the root folder itself
cd ./the-folder
zip -r ../zipped-the-folder-contents.zip *
@bradgreens
bradgreens / load-jquery-in-console.js
Created August 9, 2019 16:25
Load jQuery in the browser JS Console
var script = document.createElement('script');script.src = "https://code.jquery.com/jquery-3.4.1.min.js";document.getElementsByTagName('head')[0].appendChild(script);
@bradgreens
bradgreens / follow-redirects.sh
Created November 2, 2020 17:07
command line check redirects
curl -s -L -D - https://dat-ass.com -o /dev/null -w '%{url_effective}'
https://www.chrislatta.org/articles/web/curl/track-redirects-curl-command-line

grep examples that don't suck, er, they're so simple they kinda suck

Minimal use cases

In these examples, the is the string we're searching for.

Search one file

grep the README.md

Search files in current directory, non-recursive

grep the *

Dece Pull Requests (for TS/JS)

Prior to opening your pull request, try not to suck.

If you are seeking review/feedback before meeting this criteria, meet as much as you can and TAP a DRAFT PR.

  • Remove unecessary debugging, Ctrl+F for debugger and console.log, remove unecessary noise
  • Review & improve comments, Ctrl+F for // and /**, pretend you're not you and see if they make sense
  • TS/JS Lint passes