Skip to content

Instantly share code, notes, and snippets.

View ngault's full-sized avatar

Nick Gault ngault

  • Palo Alto, CA
View GitHub Profile
var crypto = require('crypto');
// Generate a base64 nonce of length 'len'
function randomStrBase64(len) {
return crypto.randomBytes(Math.ceil(len * 3 / 4))
.toString('base64') // convert to base64 format
.slice(0, len) // return required number of characters
.replace(/\+/g, '0') // replace '+' with '0'
.replace(/\//g, '0'); // replace '/' with '0'
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ngault
ngault / comment-SassTopFile.sublime-snippet
Last active August 29, 2015 14:16
Sublime Text snippet for SassDoc format top/file-level comment block
<snippet>
<content><![CDATA[
////
/// ${1:_fileName.scss}
/// ${2:Very brief description of file}
///
/// ${3:@author Nicholas Nuss}
/// ${4:Copyright @ 2014-15 Stagirite, Inc}
///
/// ${5:@requires 'none' or list of dependencies}
@ngault
ngault / comment-jsTopFile.sublime-snippet
Last active August 29, 2015 14:16
Sublime Text snippet for JSDoc format top/file-level comment block
<snippet>
<content><![CDATA[
/**
* ${1:fileName.js}
* ${2:@version 1.2.3}
* ${3:@fileoverview Very brief description of file}
*
* ${4:@author Nicholas Nuss}
* ${5:@copyright © Stagirite, Inc. 2015}
*
@ngault
ngault / keybase.md
Created September 30, 2014 06:16
keybase

Keybase proof

I hereby claim:

  • I am ngault on github.
  • I am ngault (https://keybase.io/ngault) on keybase.
  • I have a public key whose fingerprint is E0AE 9C98 D148 BCC4 21D8 1919 84F1 23EA 7C53 B229

To claim this, I am signing this object: