Skip to content

Instantly share code, notes, and snippets.

View willfrew's full-sized avatar

Will Frew willfrew

  • Bucharest, Romania
View GitHub Profile
@lfam
lfam / linux.scm
Created May 17, 2019 13:03
Guix package for regular mainline stable Linux kernel
(define-module (my packages linux)
#:use-module (guix download)
#:use-module (guix packages)
#:use-module (gnu packages linux))
(define (linux-url version)
"Return a download URL for Linux VERSION."
(string-append "https://cdn.kernel.org/pub/linux/kernel/"
"v" (string-take version 1) ".x/"
"linux-" version ".tar.xz"))
@eddking
eddking / review-data-export.js
Last active February 13, 2019 19:02
export pull request & review data from github via the http api
const request = require('request-promise-native');
const parseLinkHeader = require('parse-link-header');
const fs = require('fs');
/*
* This is an idempotent script for downloading pr & review data for a single repository
* Set the repo and auth variables below, then run and wait. its not speedy, but it works
*
* If you stop the script or it dies or you trigger abuse detection, it is safe to restart.
* it will only download the remaining data, any requests that were pending at the time of
@brigand
brigand / express-saga.md
Last active January 14, 2022 14:23
express-saga is a web framework based on express and the saga pattern (redux-saga's interpretation) – just an idea, let's see if it turns out decent :-)

This is an idea, the code doesn't exist

express-saga is a web framework based on express and the saga pattern (redux-saga's interpretation).

You can use all existing express middleware without issue, but often there are better alternatives in express-saga.

Most effects from redux-saga are available, along with new effects for web server development.

This library is designed with a heavy focus on unit-testability. You don't need module level mocks due to dependency injection. Your routers are pure functions, so you don't need to run a http server in tests.

@justmoon
justmoon / custom-error.js
Last active April 22, 2024 17:19 — forked from subfuzion/error.md
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);
@tboggs
tboggs / dirichlet_plots.png
Last active February 13, 2024 03:25
A script to generate contour plots of Dirichlet distributions
dirichlet_plots.png
### define function variable before block to avoid code being appended to closing part of JSDoc comment ###
cube = ''
###*
* Funtion to calculate cube of input
* @param {number} Number to operate on
* @return {number} Cube of input
###
cube = (x) -> x*x*x