Skip to content

Instantly share code, notes, and snippets.

View dannycallaghan's full-sized avatar

Danny Callaghan dannycallaghan

  • London
View GitHub Profile
@dannycallaghan
dannycallaghan / sketch-303-03.js
Created May 17, 2019 14:00
Case 303 - The Case of the Crooked Attorney Stage 3 - The Gates Bank
/*
Officer: 8018788
CaseNum: 303-2-34839955-8018788
Case 303 - The Case of the Crooked Attorney
Stage 3 - The Gates Bank
I’ve made an appointment for you at the Gates Bank to retrieve your safe deposit box from the vault.
Actually you will break into Torvalds’ one.
// index.js
<React.StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>
// App.js - notice how Home is nested in Layout
@dannycallaghan
dannycallaghan / Memoization Pattern.js
Created October 9, 2013 08:08
Memoization Pattern From 'JavaScript Patterns' (O'Reilly) by Stoyan Stefanov.
/* Memoization Pattern */
// a single parameter example
var myFunc = function ( param ) {
if ( !myFunc.cache[ param ] ) {
var result = {};
// ... expensive operation ...
myFunc.cache[ param ] = result;
}
return myFunc.cache[ param ];
@dannycallaghan
dannycallaghan / sketch-302-03.js
Created June 10, 2019 14:07
Case 3 - Stage 4
/*
The case of the slippery Minsky brothers
Stage 4: Gates Memorial Art Museum
Officer: 8018788
CaseNum: 302-3-36685406-8018788
Darn it ! All three Minskys have broken out of the county jail. I told you they were slippery. Word has it that they are planning their biggest heist yet. Tonight they plan to steal multiple priceless artworks from the Gates Memorial Art Museum. I’ve assembled you a team. Head down to the Museum and stop them.
- Edit the spotlight object by creating x and y properties initialised to your location. Also endX and endY properties initialised to one of the Minsky's location.
@dannycallaghan
dannycallaghan / Case 502 - A delicate matter - stage 2
Created January 8, 2020 23:15
Case 502 - A delicate matter - stage 2
/*
Officer: 8018788
CaseNum: 502-1-27755867-8018788
Case 502 - A delicate matter - stage 2
We’re hot on the trail kid, and another document has come my way.
It’s a little more tricky to decipher but I know you can do it.
@dannycallaghan
dannycallaghan / sketch-303-02.js
Created April 23, 2019 08:43
Case 303 - Stage 2
/*
Officer: 8018788
CaseNum: 303-2-34839955-8018788
Case 303 - The Case of the Crooked Attorney
Stage 3 - The Gates Bank
I’ve made an appointment for you at the Gates Bank to retrieve your safe deposit box from the vault.
Actually you will break into Torvalds’ one.
@dannycallaghan
dannycallaghan / ShowHiddenFiles.sh
Created January 17, 2014 10:58
Show hidden files in OSX
// Show hidden files
$ defaults write com.apple.finder AppleShowAllFiles -boolean true
$ killall Finder
// Hide hidden files
$ defaults delete com.apple.finder AppleShowAllFiles
$ killall Finder
@dannycallaghan
dannycallaghan / 601-2-97128180-8018788.js
Created July 18, 2019 19:22
601-2-97128180-8018788
/*
Officer: 8018788
CaseNum: 601-2-97128180-8018788
Case 601 - Murdering Again - stage 3
Now murders are beginning to occur.
If we can place her near any of the recent crime scenes in the area we should be able narrow down her location.
In the setup function, use a for loop to graph all of the points on the map
@dannycallaghan
dannycallaghan / sketch-402-04-new.js
Created April 23, 2019 10:37
Case 402 - Stage 4 - New
/*
402 - The case of the Why Gang ruby heist
Stage 4 - Fox
Officer: 5980088
CaseNum: 402-3-22317853-5980088
This final Why gang member Fox is the boss of the gang. Fox is particularly
cunning and has hidden herself down this twisted network of alleys known as
vice city. Head into vice city to find her but don’t get lost!
@dannycallaghan
dannycallaghan / sketch-402-04.js
Created April 23, 2019 08:45
Case 402 - Stage 4
/*
402 - The case of the Why Gang ruby heist
Stage 4 - Fox
Officer: 8018788
CaseNum: 402-3-96700118-8018788
This final Why gang member Fox is the boss of the gang. Fox is particularly
cunning and has hidden herself down this twisted network of alleys known as
vice city. Head into vice city to find her but don’t get lost!