Skip to content

Instantly share code, notes, and snippets.


Ryan Burnette ryanburnette

View GitHub Profile
Ivan-Feofanov / getMethods.js
Last active Jun 6, 2020
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.associations[assoc].accessors[accessor]+'()');
dehamzah / generate.js
Last active Oct 29, 2020
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 /
Last active Nov 10, 2020
From Require.js to Webpack - Part 2 (the how)

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 /
Last active Nov 27, 2020
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
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 / Gemfile
Created Jan 9, 2014
kramdown-rails: Use Kramdown (Markdown) in Rails 4
View Gemfile
# Gemfile
gem 'kramdown'
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}
You can’t perform that action at this time.