Skip to content

Instantly share code, notes, and snippets.

.
├── books
│   ├── handlers.go
│   └── models.go
├── config
│   └── db.go
└── main.go
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active March 24, 2025 20:20
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@nkbt
nkbt / .eslintrc.js
Last active April 1, 2025 03:07
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@paulirish
paulirish / bling.js
Last active February 18, 2025 14:08
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };
@rolaveric
rolaveric / karma-systemjs.conf.js
Created January 21, 2015 10:07
Snippet of a Karma configuration using karma-systemjs
// Add 'karma-systemjs' to the list of plugins
plugins: ['karma-systemjs', ...],
// Add 'systemjs' to the list of frameworks
frameworks: ['systemjs', 'jasmine'],
// Move all the `files` to `systemjs.files`
files: [],
systemjs: {

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@twalker
twalker / backbone-promises.js
Last active September 3, 2023 17:08
Monkey patch Backbone sync operations to return ES6 promises
/**
* backbone-promises returns ES6 Promises for Backbone.sync operations.
* @return {Object} monkey-patched Backbone.
*
*/
define(['backbone-lib', 'es6-promise'], function(Backbone, Promise){
// Backbone.ajax to return native ES6 promises for ajax calls insead of jQuery.Deferreds
Backbone.origAjax = Backbone.ajax;
Backbone.ajax = function ajax(){
#!/usr/bin/env node
var program = require('commander');
var request = require('request');
var chalk = require('chalk');
program
.version('0.0.1')
.usage('[options] <keywords>')
.option('-o, --owner [name]', 'Filter by the repositories owner')
@grafikchaos
grafikchaos / Cherry Picking Multiple Commits.md
Last active October 7, 2024 14:42
Cherry pick multiple commits from a remote or upstream branch