In functional programming you often want to apply a function partly. A simple example is a function add
.
It would be nice if we could use add
like:
var res2 = add(1, 3); // => 4
var add10To = add(10);
var res = add10To(5); // => 15
<div>{"<"} Less than, {">"} greater than </div> |
{ stdenv, lib, bash, callPackage, writeText, makeWrapper, writeScript, dotnet-sdk, | |
patchelf, libunwind, coreclr, libuuid, curl, zlib, icu }: | |
let | |
config = "Staging"; | |
project = "RazorCx.Api"; | |
target = "linux-x64"; | |
rpath = stdenv.lib.makeLibraryPath [ libunwind coreclr libuuid stdenv.cc.cc curl zlib icu ]; |
function translateError(msg) { | |
var newErr = new Error(msg); // placed here to get correct stack | |
return e => { | |
newErr.originalError = e; | |
throw newErr; | |
} | |
} | |
async function asyncTask() { | |
const user = await UserModel.findById(1).catch(translateError('No user found')) |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
We have absolutely no idea what we're doing in tech. Please explain the utmost basic things to us.
We only do web design. Our whole reason of being in tech is to make things pretty. Consider us the doilies of the industry.
We're not laughing about your joke, so we clearly need you explain it to us. In great detail.
We're only in tech to find a husband, boyfriend or generally to get laid.
// See comments below. | |
// This code sample and justification brought to you by | |
// Isaac Z. Schlueter, aka isaacs | |
// standard style | |
var a = "ape", | |
b = "bat", | |
c = "cat", | |
d = "dog", |
Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/