This file contains 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 fs = require("fs"); | |
const lineDelimiter = "\r\n"; | |
const entryDelimiter = ""; | |
const lines = fs.readFileSync("./non-unique.txt", { | |
encoding: "utf8", | |
flag: "r", | |
}); |
This file contains 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
#!/bin/bash | |
# Example next versions when latest tag is 'v2.4.6': | |
# - major --> v3.0.0 | |
# - minor --> v2.5.0 | |
# - patch --> v2.4.7 | |
# ------------------------------------------------------ | |
TAGS_PREFIX="v" |
This file contains 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
16:43:30 ~/development/go/test-go-modules-and-tests | |
$ ll ~/go-work/pkg/mod/github.com/shopspring | |
ls: cannot access '/home/jacekk/go-work/pkg/mod/github.com/shopspring': No such file or directory | |
16:43:46 ~/development/go/test-go-modules-and-tests | |
$ ll | |
total 8,0K | |
-rw-rw-r-- 1 jacekk jacekk 141 May 17 16:19 foo.go | |
-rw-rw-r-- 1 jacekk jacekk 211 May 17 16:23 foo_test.go |
This file contains 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
// Implementation in ES6 | |
function pagination(c, m) { | |
var current = c, | |
last = m, | |
delta = 2, | |
left = current - delta, | |
right = current + delta + 1, | |
range = [], | |
rangeWithDots = [], | |
l; |
This file contains 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
#!/bin/bash | |
# Usage: ./s3-remove-old-files "bucket-name" "nested-path" 1000 | |
if [ ! "$1" ]; then | |
echo "1st arg (bucket name) NOT specified !!" | |
exit 1 | |
fi | |
if [ ! "$2" ]; then | |
echo "2nd arg (bucket sublocations) NOT specified !!" |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>RQ debug</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="row"> </div> |
This file contains 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
$ node ./test-imports.js | |
Ghost created | |
Ghost says: x | |
Ghost says: a | |
Ghost says: b | |
Ghost says: c |
This file contains 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 assocArray = ['zero', 'one', 2, 3, 4]; | |
assocArray['five'] = 5; | |
assocArray[7] = 'seven'; | |
const plainObj = { | |
zero: '0', | |
one: '1', | |
2: 'two', | |
4: 4, | |
5: 'fifth', |
This file contains 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
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ai %ar by %an" $branch | head -n 1` \\t$branch; done | sort -r |
This file contains 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
Object.keys(window).filter(function(x) { | |
return window[x] instanceof Function && !/\[native code\]/.test(window[x].toString()); | |
}); |
NewerOlder