Skip to content

Instantly share code, notes, and snippets.

Ryan Burnette ryanburnette

Block or report user

Report or block ryanburnette

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
@Ivan-Feofanov
Ivan-Feofanov / getMethods.js
Last active Mar 12, 2019
Get list of association methods of model in Sequelize
View getMethods.js
const model = %yourSequelizeModel%
for (let assoc of Object.keys(model.associations)) {
for (let accessor of Object.keys(model.associations[assoc].accessors)) {
console.log(model.name + '.' + model.associations[assoc].accessors[accessor]+'()');
}
}
@dehamzah
dehamzah / generate.js
Last active Nov 11, 2019
Generate secret key in NodeJS
View generate.js
require('crypto').randomBytes(48, function(err, buffer) { var token = buffer.toString('hex'); console.log(token); });
View webpack.config.js
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@xjamundx
xjamundx / blog-webpack-2.md
Last active Nov 12, 2019
From Require.js to Webpack - Part 2 (the how)
View blog-webpack-2.md

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active Nov 21, 2019
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon
View ultimate-ut-cheat-sheet.md

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


View gist:705da4c6574a4441b488
{
"repositories": [
{
"type": "package",
"package": {
"name": "advanced-custom-fields/advanced-custom-fields-pro",
"version": "5.1.3",
"type": "wordpress-plugin",
"dist": {
"type": "zip",
View _syntax.sass
// Jekyll Pygments syntax highlighter styles
// Color scheme
$base03: #002B36
$base02: #073642
$base01: #586E75
$base00: #657B83
$base0: #839496
$base1: #93A1A1
$base2: #EEE8D5
@remino
remino / Gemfile
Created Jan 9, 2014
kramdown-rails: Use Kramdown (Markdown) in Rails 4
View Gemfile
# Gemfile
gem 'kramdown'
@namusyaka
namusyaka / gist:8265452
Last active Dec 15, 2017
BetterErrors with Padrino 0.12
View gist:8265452
module Foobar
class App < Padrino::Application
enable :sessions
configure :development do
use BetterErrors::Middleware
BetterErrors.application_root = PADRINO_ROOT
set :protect_from_csrf, except: %r{/__better_errors/\d+/\w+\z}
end
....
You can’t perform that action at this time.