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++;