Skip to content

Instantly share code, notes, and snippets.

View tvardy's full-sized avatar
💸
open for remote cooperation

Grzegorz (Greg) Twardowski tvardy

💸
open for remote cooperation
View GitHub Profile
@tvardy
tvardy / ultimate-ut-cheat-sheet.md
Created March 4, 2017 20:03 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@tvardy
tvardy / .info.md
Last active March 18, 2017 21:52
POC: istanbul (nyc) + mocha + watch

POC: using Istanbul's nyc CLI with mocha and watch ability (using nodemon)

Also works great with live-server for observing html reports

"scripts": {
  "watch:test:coverage": "concurrently \"live-server ./coverage\" \"nodemon -x npm run test:coverage\""
},
"devDependencies": {
 ...
@tvardy
tvardy / curry.js
Last active July 1, 2017 20:10
JS currying example
// the prime hero here
function curry(func, expectedCount, ...args) {
function _check(arr) {
return arr.length >= expectedCount ? _result(arr) : _curry.bind(null, arr)
}
function _curry(prev, ...rest) {
return _check(prev.concat(rest))
}
@tvardy
tvardy / app.js
Created July 3, 2017 10:10
Quickly scrape currently available 2-4 letter NPM package names (with results below). Last updated July 1, 2017.
const chalkline = require('chalkline');
const npmName = require('npm-name');
const request = require('request-promise-native');
const api = 'https://www.wordgamedictionary.com/word-lists/$-letter-words/get.json?limit=0&offset=0&order=asc';
(async function check() {
try {
for (let i=2; i<=4; i++) {
@tvardy
tvardy / .editorconfig
Last active December 14, 2017 07:33
my minimal initial commit contents
root = true
[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
@tvardy
tvardy / urls.txt
Created January 12, 2018 09:00 — forked from metafeather/urls.txt
Paths to test a web server with
/+CSCOE+/logon.html
/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/etc/passwd
/.%2e/.%2e/.%2e/.%2e/windows/win.ini
/.%2e/.%2e/.%2e/.%2e/winnt/win.ini
/..../..../..../..../..../..../..../..../..../..../..../..../etc/passwd
/..../..../..../..../..../..../..../..../..../windows/win.ini
/..../..../..../..../..../..../..../..../..../winnt/win.ini
/.../.../.../.../.../.../.../.../.../windows/win.ini
/.../.../.../.../.../.../.../.../.../winnt/win.ini
/.bak/
@tvardy
tvardy / .gitignore
Last active October 10, 2021 18:30
TS Observer
node_modules
*.js