Skip to content

Instantly share code, notes, and snippets.

cangoektas /
Last active Nov 10, 2018
Core rule settings of popular ESLint configs

Core rule settings of popular ESLint configs

An overview of how popular ESLint configs use the latest core rules. The rules are listed in the order they appear on the ESLint rules page:


Name Weekly NPM Downloads
eslint:recommended (installed with ESLint)
airbnb         699,637          
gaearon / connect.js
Last active Jul 18, 2022
connect.js explained
View connect.js
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
jdxcode / boot.js
Last active May 25, 2021
zero-downtime node.js app runner
View boot.js
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run
sh1n0b1 /
Created Apr 8, 2014
Python Heartbleed (CVE-2014-0160) Proof of Concept
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
dergachev /
Last active Aug 3, 2022
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF


To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

ndarville /
Last active Jul 30, 2022
Business models based on the compiled list at I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models


Models Examples
Display ads Yahoo!
Search ads Google
scttnlsn / base_view.js
Created May 8, 2012
Backbone.js base view
View base_view.js
var BaseView = Backbone.View.extend({
close: function() {
if (this.onClose) this.onClose();
davatron5000 / gist:2254924
Created Mar 30, 2012
Static Site Generators
View gist:2254924

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.


View gist:1682643
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using FluentAssertions;
using NUnit.Framework;
using Nancy.Helpers;
namespace NancySelfHosting
jimbojsb / gist:1630790
Created Jan 18, 2012
Code highlighting for Keynote presentations
View gist:1630790

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: