Copied from: stackoverflow
Our example port is 3000. Replace it with the port number you need.
Copied from: stackoverflow
Our example port is 3000. Replace it with the port number you need.
git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done |
/* | |
* pubNameGenerator | |
* | |
* Copied parts from: https://github.com/pablorecio/pubnamegenerator | |
* License: MIT | |
* | |
*/ | |
const THINGS = [ | |
"Albion", |
Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
Source: Increase file upload size limit in PHP-Nginx
vim /etc/php5/fpm/php.ini
// var n = 6; | |
// var ppp = new Array(n).fill(0).map((_, i) => | |
// n % 2 // if n is odd | |
// ? i === 0 // if index is 0 | |
// ? 0 // return 0 | |
// : i % 2 // if index is odd | |
// ? i + 1 // return index + 1 | |
// : - i // return - index | |
// : i % 2 // if index is odd | |
// ? - i // return - index |
// This son of a bitch goes until the middle of the array | |
// and flips each item with it's mirrored item from the end | |
let arr = [1, 7, 2, 5, 9]; | |
const halfLength = arr.length / 2; | |
const maxI = arr.length - 1; | |
for (let i = 0; i <= parseInt(halfLength); i=i+1) { | |
let m = maxI - i; | |
let a = arr[i]; | |
let b = arr[m]; |
Count lines of this file
cat ./README.md | wc -l
Convert input from standard input into arguments to a command
var valuesToBeDeleted = [1, 5, 7, 15]; | |
var mixedValues = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]; | |
// Boring solution: | |
valuesToBeDeleted.forEach(item => { | |
var itemIndex = mixedValues.indexOf(item); | |
mixedValues.splice(itemIndex, 1); | |
}); | |
// Better solution: |