Skip to content

Instantly share code, notes, and snippets.

View paulosborne's full-sized avatar

Paul Osborne paulosborne

  • Yorkshire, UK
View GitHub Profile
@MichaelDimmitt
MichaelDimmitt / bash-helpers-for-jest.md
Last active July 8, 2024 05:54
bash helpers for jest

Identify what jest files have failing tests:

yarn test --maxWorkers=50% 2>&1 | grep FAIL | sort -u

How to find tests that take longer than 400ms

yarn test --testTimeout=400 2>&1 | grep FAIL

Some of these tests may take some time as they have user interaction.

@cferdinandi
cferdinandi / README.md
Last active April 27, 2019 14:51
Monsters! game project template from https://learnvanillajs.com.

Project Details

Build a game inspired by the movie Monsters, Inc. and loosely based on the old PC game Minesweeper.

Create a three-by-four grid of 12 doors. When the user clicks a door, they'll find one of their monster friends. But behind one door is a human sock. These are dangerous and should be avoided at all costs. Finding it means you lose the game.

If the user finds all 11 monster friends without stumbling onto the sock, they win!

Note: SVG files for the monsters, sock, and door have been included for you.

@kimmobrunfeldt
kimmobrunfeldt / 0-osx-for-web-development.md
Last active July 26, 2022 13:30
Install web development tools to Mavericks (OS X 10.9)

Install web development tools to Mavericks (OS X 10.9)

Strongly opinionated set of guides to quickly setup OS X Mavericks for web development. By default OS X hides stuff that normal people don't need to see. These settings are better defaults for developers.

I don't want: any sounds, annoying confirmation dialogs, hidden extensions, superflous animations, unnecessary things running like Dashboard, Notification center or Dock(Alfred/spotlight works better for me).

These are my opinions. Read this document through and pick up the good parts to your preferences.

System preferences

@domenic
domenic / removing-module-x-from-y.md
Last active August 29, 2015 14:02
Practical implications of removing `module x from "y"`

Practical Implications of Removing module x from "y"

Background

According to this gist, the modules break-out session at TC39 (a subset of the larger committee) decided to remove the

module x from "y";
@agendor
agendor / hapijs-rest-api-tutorial.md
Last active August 31, 2021 08:31
A practical introduction to building a RESTful API with the hapi.js server framework for Node.js
@hgfischer
hgfischer / benchmark+go+nginx.md
Last active April 11, 2024 22:09
Benchmarking Nginx with Go

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI
@relaxdiego
relaxdiego / graphite.md
Last active January 5, 2022 09:07 — forked from surjikal/graphite.md
Installing Graphite in OS X Mavericks

Follow these steps to install graphite on OS X Mavericks.

Prerequisites

  • Homebrew
  • Python 2.7
  • Git

Install dependencies

Install Cairo and friends

@mattmccray
mattmccray / router.js
Last active December 26, 2015 14:29
Simple Backbone/Exoskeleton Router for use with React (http://facebook.github.io/react/)
var _missing= function(data){ return React.DOM.pre(null, "Route not found: "+ data.route) },
_router= null,
_started= false,
_nextId= 1;
function handleRouteChange(container, component) {
var routeParams= Array.prototype.slice.call( arguments, 1 )
React.renderComponent(
component({ routeParams:routeParams }, null),
container
@tristanbes
tristanbes / example.sh
Created November 9, 2012 15:53
Install Graphite on Debian Server
# Installing graphite dependencies
apt-get install -y python2.6 python-pip python-cairo python-django python-django-tagging
apt-get install -y libapache2-mod-wsgi python-twisted python-memcache python-pysqlite2 python-simplejson
pip install whisper
pip install carbon
pip install graphite-web
# Setup a vhost by grabbing the example the graphite team released on their repo.
# In this file, you'll provide the url used to access to your Graphite dashboard
wget https://raw.github.com/tmm1/graphite/master/examples/example-graphite-vhost.conf -O /etc/apache2/sites-available/graphite
@domenic
domenic / promises.md
Last active June 24, 2024 03:11
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.