Skip to content

Instantly share code, notes, and snippets.

View filipesilva's full-sized avatar

Filipe Silva filipesilva

  • Dublin, Ireland
View GitHub Profile
(ns pie-a-la-mode
(:require [clojure.core.async :as a]))
;; Concurrency example from The Pragmatic Programmers. Waiters check if there's
;; enough pie and ice cream before they sell an order, but if they don't
;; coordinate it's still possible to sell more than we have.
;;
;; The below code should return either :ok or :not-available for a given order.
(def recipes
@filipesilva
filipesilva / profile.js
Created July 19, 2019 14:40
Angular CLI profiling script
const fs = require("fs");
const path = require("path");
// Usage instructions:
// - open node_modules/@angular/cli/lib/init.js
// - replace the code below
// ```
// cli({
// cliArgs: process.argv.slice(2),
// inputStream: standardInput,
NM353851668766
LN353852700559
BC351914564584
FO447771501423
SA351936839220
FS353852190819
@filipesilva
filipesilva / self-rep.js
Created November 9, 2016 15:40
self-rep.js
let program = `
let program = \`#ref\`;
let delimiter = String.fromCharCode(92) + String.fromCharCode(96);
program = program.replace(\`#ref\`, program.replace(/\`/g, delimiter));
console.log(program);
`;
let delimiter = String.fromCharCode(92) + String.fromCharCode(96);
program = program.replace(`#ref`, program.replace(/`/g, delimiter));
console.log(program);
### Keybase proof
I hereby claim:
* I am filipesilva on github.
* I am filipematossilva (https://keybase.io/filipematossilva) on keybase.
* I have a public key whose fingerprint is 0179 763D 3D1D AFBC BCDC D3F0 44C2 1C75 D66E D0B2
To claim this, I am signing this object: