SPC q q
- quitSPC w /
- split window verticallySPC w
- - split window horizontallySPC 1
- switch to window 1SPC 2
- switch to window 2SPC w c
- delete current windowSPC TAB
- switch to previous bufferSPC b b
- switch buffers
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
.*(?:\/) |
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
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
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
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
# 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
// 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
script = document.createElement('script') | |
script.src = "https://cdn.rawgit.com/turbolinks/turbolinks/1066805f/dist/turbolinks.js" | |
document.head.appendChild(script) |
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
mkdir emacs | |
cd emacs | |
git init | |
git remote add origin https://github.com/emacs-mirror/emacs.git | |
git fetch --depth 1 origin emacs-26 | |
git reset --hard FETCH_HEAD | |
sudo apt install autoconf make gcc texinfo libgtk-3-dev libxpm-dev libjpeg-dev libgif-dev libtiff5-dev libgnutls-dev libncurses5-dev | |
./configure | |
make | |
sudo make install |
OlderNewer