Skip to content

Instantly share code, notes, and snippets.

View begroff's full-sized avatar

Brett Groff begroff

View GitHub Profile
@cjkoepke
cjkoepke / logging_errors.js
Created August 10, 2017 18:20
Debugging tips and tricks.
// Great for getting values, outputting context strings, and so on.
console.log(variable)
// Same as console.log(), but prints in yellow as a warning. Useful to show a non-breaking error in a dev env.
console.warn('It is a good idea to use .map instead of a for-loop.')
// Same as console.log(), but prints in red as an error. Useful to show a breaking error in a dev env.
console.error(`The value must be an integer. You provided a ${typeof variable}.`)
// Group console data together for better viewing. Nice to group console logs together.
@msveden
msveden / test-post-receive-without-push.md
Last active April 13, 2018 12:22
Testing post-receive hook without pushing changes

Find the last two commits by:

git log -2 --format=oneline --reverse

Then run the hook by:

echo "[from-commit-id] [to-commit-id] master" | ./hooks/post-receive

/**
* Settings
*/
var settings = {
scripts: true, // Turn on/off script tasks
polyfills: true, // Turn on/off polyfill tasks
styles: false, // Turn on/off style tasks
svgs: false, // Turn on/off SVG tasks
static: false, // Turn on/off static file copying
@Kmaschta
Kmaschta / generate-self-signed-certificate-with-custom-CA.md
Created January 9, 2019 14:43
How to generate a self-signed that is valid for your browser (by creating your custom certificate authority)

If you're using self-signed certificate for your web server on development, you might know the browser warning saying that your certificate isn't valid. If like me you had manually added an exception for this certificate error each time it showed up, this gist is for you.

Properly Configure OpenSSL with your DNS aliases

You'll have to create a self-signed certificate with a custom SubjectAltName.

  1. Find your openssl config. find /usr/lib -name openssl.cnf
@Kaapiii
Kaapiii / fix-vgacon-disable-amdgpu.md
Created April 16, 2020 13:58
Ubuntu 19.10 and Ubuntu 20.04 (beta) - "Unknown display" / Unable to detect multiple displays with Radeon rx570 gpu

Ubuntu is not able to detect multipble displays when using an gpu from AMD. Error "VGACON disables amdgpu ..."

When searching for graphics card with "sudo lshw -c video" on Ubuntu 19.10 or 20.04 (beta) the following error is shown:

# list graphics/video cards
sudo lshw -c video
#[drm:amdgpu_init [amdgpu]] *ERROR* VGACON disables amdgpu kernel mode setting.