Skip to content

Instantly share code, notes, and snippets.

###
Silence STDOUT & STDERR streams during tests
Useful for Yeoman to provide a cleaner output
@uses github.com/balderdashy/fixture-stdout
Yeoman Usage:
If your generator logs anything on the 'end' event
you can add an additional event as the very last
thing and trigger Output.unmute() on that event instead.
```

Keybase proof

I hereby claim:

  • I am MethodGrab on github.
  • I am methodgrab (https://keybase.io/methodgrab) on keybase.
  • I have a public key whose fingerprint is 3EC4 8DED D59C 1639 C155 9B7E 16A6 BAB1 4BA2 0968

To claim this, I am signing this object:

@MethodGrab
MethodGrab / README.md
Last active February 22, 2023 14:15
Jenkins NodeJS Plugin: Missing nodejs.org installers

Jenkins NodeJS Plugin: Missing nodejs.org installers

Versions

  • Ubuntu 14.04 LTS x64
  • Java 1.7
  • Jenkins 1.639
  • NodeJS plugin 0.2.1
@MethodGrab
MethodGrab / gist:6ff47d8cbcc017bdc8d0e136700b2b44
Created March 30, 2016 15:00 — forked from ptz0n/gist:1646171
Recursive merge of arrays with integer keys
<?php
/**
* Merge two dimensional arrays my way
*
* Will merge keys even if they are of type int
*
* @param array $array1 Initial array to merge.
* @param array ... Variable list of arrays to recursively merge.
*
@MethodGrab
MethodGrab / macOS External Display Fix.md
Last active November 16, 2022 20:54
A fix for blurry text on external displays in macOS & OS X

macOS External Display Fix

A fix for blurry text on external displays in macOS & OS X.

  1. Run the patch (src) which will create a new directory in the CWD called DisplayProductID-YYYY:

    ruby ./patch-edid.rb
  2. Reboot into recovery mode (hold down CMD-R while rebooting)

@MethodGrab
MethodGrab / mongo-autostart-osx.md
Created May 23, 2016 08:02 — forked from subfuzion/mongo-autostart-osx.md
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

@MethodGrab
MethodGrab / svg-classes.js
Created June 6, 2016 09:51 — forked from branneman/svg-classes.js
SVG — hasClass, addClass, removeClass, toggleClass
//
// SVG — hasClass, addClass, removeClass, toggleClass
// Source:
// https://gist.github.com/branneman/8436956
// Taken and adapted from:
// http://toddmotto.com/hacking-svg-traversing-with-ease-addclass-removeclass-toggleclass-functions/
//
if (SVGElement && SVGElement.prototype) {
@MethodGrab
MethodGrab / nginx.conf
Created June 22, 2016 15:40 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@MethodGrab
MethodGrab / gist:79b792ab4185e358e7ce482ac6373f9d
Created August 10, 2016 16:30 — forked from clintel/gist:1155906
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code
    

Difference between Debounce and Throttle

Debounce

Debounce a function when you want it to execute only once after a defined interval of time. If the event occurs multiple times within the interval, the interval is reset each time.
Example A user is typing into an input field and you want to execute a function, such as a call to the server, only when the user stops typing for a certain interval, such as 500ms.

Throttle