This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Some of these answers will only run in Firefox (browsers which support TCO) | |
/** | |
* Problem 1 | |
* If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. | |
* Find the sum of all the multiples of 3 or 5 below 1000. | |
*/ | |
const problem1 = () => { | |
return Array(1000) | |
.fill(null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# functional | |
Enum.sum(Integer.digits(trunc(:math.pow(2,1000)))) | |
# Pipe | |
:math.pow(2,1000) |> trunc |> Integer.digits |> Enum.reduce(&(&1+&2)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo sysctl -w net.inet.ip.ttl=65 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function concurrent(maxConcurrency = 4) { | |
const thingsToOperateOn = []; | |
const createConcurrentPromise = () => { | |
const thing = thingsToOperateOn.shift(); | |
return new Promise((resolve, reject) => { | |
// Do something to thing | |
console.log(thing); | |
}) | |
.then(() => { | |
createConcurrentPromise(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const package ={ | |
"name": "project-euler", | |
"version": "1.0.0", | |
"description": "Evan Louie's solutions to the problems found on https://projecteuler.net", | |
"main": "./dist/bundle.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"build": "webpack -p --progress", | |
"watch": "webpack -d --progress --watch" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function actionDumpFields() | |
{ | |
$name = 'Resource'; | |
$matrixFieldHandle = 'resource'; | |
$section = 'resources'; | |
$entryType = 'resources'; | |
$schema = CRAFT_CONFIG_PATH.'/schema.yml'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.*(?:\/) |
NewerOlder