Skip to content

Instantly share code, notes, and snippets.

View camilleriluke's full-sized avatar
🐢

Luke Camilleri camilleriluke

🐢
View GitHub Profile
@camilleriluke
camilleriluke / readme.md
Last active July 5, 2019 09:35
Answering this question
['0', '1','2','2','1','0'].map(parseInt)

A: 0, 1, 2, 2, 1, 0
B: 0, 0, 0, 0, 0, 0
C: 0, NaN, NaN, 2, 1, 0
D: 0, NaN, NaN, NaN, NaN, NaN
E: NaN, NaN, NaN, NaN, NaN, NaN
@camilleriluke
camilleriluke / PR.md
Created June 25, 2019 14:03
Reviewing PRs

One of the main reasons is, to make sure that we always get another set of 👀 on all the code that is going into production. And secondly, it's to improve our collective knowledge 🧠.

When you're reviewing a PR:

  • ❓ If you do not understand something, ask why, it was done this way.
  • 💕 If you like something, point out that you liked it.
  • 🐠 If you see something fishy, voice your concern and suggest ways how we can make it better.
  • 🏰 Don’t just think about the raw lines of code being added/removed. Think about the impact of this change in the project in general.
  • 🔍 And, be thorough, dry run the code in your head, see if it makes sense, you can catch bugs before they even get merged (P.S. the only way to get better at this is to practice it a lot! So go ahead and start today :man-lifting-weights:).
  • 🤝 No one is here to judge, that is not our job. Don't be shy to share your work and comment on other people's work. The goal is to impro
var PARENT_LABEL = 'GH';
var GITHUB_NOTIFICATION_EMAIL = '[email protected]';
var ISSUE_STRING = "\"description\": \"View this Issue on GitHub\"";
var PR_STRING = "\"description\": \"View this Pull Request on GitHub\"";
function addGitHubLabels() {
// Let's do some set up here
createLabelIfNeeded(PARENT_LABEL);
@camilleriluke
camilleriluke / repo-labels.sh
Last active September 3, 2020 19:11
Github repository labels standard
#!/usr/bin/env bash
# You can craete a token from https://github.com/settings/tokens and give the
# "repo" persmission to the token
AUTH_TOKEN=$1
OWNERREPO=$2
if [[ "$#" -ne 2 ]]; then
echo "Usage: $0 AUTH_TOKEN OWNER/REPO\n"
exit 1
@camilleriluke
camilleriluke / good-morning.js
Last active April 5, 2022 06:35
Good morning everyone 🐒
#! /usr/bin/env node
var e = ['🐒','🦍','🦧','🐶','🐕','🐩','🐺','🦊','🦝','🐱','🐈','🐈‍⬛','🦁','🐯','🐅','🐆','🐴','🐎','🦄','🦓','🦌','🦬','🐮','🐂','🐃','🐄','🐷','🐖','🐗','🐏','🐑','🐐','🐪','🐫','🦙','🦒','🐘','🦣','🦏','🦛','🐭','🐁','🐀','🐹','🐰','🐇','🐿️','🦫','🦔','🦇','🐻','🐻‍❄️','🐨','🐼','🦥','🦦','🦨','🦘','🦡','🦃','🐔','🐓','🐣','🐤','🐥','🐦','🐧','🕊️','🦅','🦆','🦢','🦉','🦤','🦩','🦚','🦜','🐸','🐊','🐢','🦎','🐍','🐲','🐉','🦕','🦖','🐳','🐋','🐬','🦭','🐟','🐠','🐡','🦈','🐙','🐚','🪸','🐌','🦋','🐛','🐜','🐝','🪲','🐞','🦗','🪳','🕷️','🦂','🦟','🪰','🪱','🦀','🦞','🦐','🦑']
console.log(`Good morning everyone ${e[Math.floor(Math.random()*e.length)]}`)
@camilleriluke
camilleriluke / durandal-router-events.js
Last active March 20, 2019 06:42
durandal router events
router.on('router:navigation:complete', e => {
console.log('🐞 router:navigation:complete', e);
});
router.on('router:navigation:cancelled', e => {
console.log('🐞 router:navigation:cancelled', e);
});
router.on('router:navigation:processing', e => {
console.log('🐞 router:navigation:processing', e);
});
router.on('router:route:activating', e => {
@camilleriluke
camilleriluke / plot.sh
Created September 4, 2018 14:41
example plot
#!/usr/local/bin/gnuplot --persist
# If you want to save on disk png … or set "export GNUTERM=x11" for X11 screen window
set terminal png
set output "result.plo.png"
set title "Benchmark1"
set size 1,0.7
set xlabel 'requests'
set ylabel 'ms'
# if you want to use autoscale use "set autoscale xy"
set xrange [0:100]
import { concat, defer, empty, of } from "rxjs";
import { flatMap, reduce, scan, take } from "rxjs/operators";
const fetchPage = (pageNumber = 0) =>
new Promise(r => {
setTimeout(() => {
// console.log("fetching page ", pageNumber);
if (pageNumber >= 5) {
return r({ results: "done" });
}
@camilleriluke
camilleriluke / asyncIterator-doodling.js
Created June 18, 2018 00:57
AsyncIterator doodling
const sleep = ms => new Promise(r => setTimeout(r, ms));
const numbersFromGenerator = fromI => {
let i = fromI;
return {
[Symbol.asyncIterator]: async function*() {
while (true) {
await sleep(500);
yield i++;