A coworker shared a TypeScript snippet. Here's my thoughts.
Here's the [paraphrased] message:
Something I thought I'd post here... one of the most useful custom types I've seen and used:type ClassName<T> = { new (...args: Array<any>): T }
const operands = [ | |
[ 'Third Normal Form Databases' ], | |
[ 'exception handling' ], | |
[ 'computer science degree', 'a' ], | |
[ 'Capability Maturity Model', 'a' ], | |
[ 'GitHub profile', 'a' ], | |
[ 'variadic pure functions' ], | |
[ 'requirements analysis' ], | |
[ 'abstract base classes'], | |
[ 'row-level locking' ], |
diff --git a/Gruntfile.js b/Gruntfile.js | |
index dc80c05..7228c67 100644 | |
--- a/Gruntfile.js | |
+++ b/Gruntfile.js | |
@@ -10,7 +10,10 @@ | |
module.exports = function (grunt) { | |
// Load grunt tasks automatically | |
- require('load-grunt-tasks')(grunt); | |
+ require('jit-grunt')(grunt, { |
// http://coderbyte.com/CodingArea/GuestEditor.php?ct=Weighted%20Path&lan=JavaScript | |
var input = ['4','A','B','C','D', 'A|B|2', 'C|B|11', 'C|D|3', 'B|D|2']; | |
var output = 'A-B-D'; | |
console.log(output === (function (strArr) { 'use strict'; | |
// Process input data | |
var count = strArr.shift() | |
, nodes = strArr.splice(0, count) |
'use strict'; | |
var input = [ | |
'[[({}{})]{}]', | |
'][(}))(}})]', | |
'[(){}]', | |
']()', | |
'{([]{})()}' | |
] | |
, output = [1, 0, 1, 0, 1 ] |
Abomination | |
Ancient Darkspawn | |
Ancient Rock Wraith | |
Anders | |
Apostate Wanderer | |
Arcane Horror | |
Arlathan General | |
Armored Bear | |
Armored Ogre | |
Ashaad |
{ | |
// ... | |
"build_systems": | |
[ | |
{ | |
"cmd": "echo 'Found console.log() statement(s):'; grep -rEnio 'console.log\\(.+\\).*\\$' --exclude-dir=app/bower_components app | awk -F: '{printf \" - %-30s%-7s%-s\\n\", \\$1, \\$2, \\$3}'; echo", | |
"name": "Find console.log()", | |
"shell": true, |
... | |
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2 | |
> [email protected] postinstall /home/deck0/foo/node_modules/grunt-contrib-imagemin/node_modules/gifsicle | |
> node lib/check.js | |
gifsicle: downloading [===================] 100% 0.0s | |
✗ pre-build test failed, compiling from source... |
bobstrap() { | |
# CONFIG | |
GIT_USERNAME='thebobg' | |
GIT_REPONAME='bobStrap' | |
GIT_BRANCH='master' | |
# Stop Editing Below Here | |
curl -L -s -o /tmp/"$GIT_REPONAME".tar.gz https://api.github.com/repos/"$GIT_USERNAME"/"$GIT_REPONAME"/tarball/"$GIT_BRANCH" | |
tar -xf /tmp/"$GIT_REPONAME".tar.gz --strip 1 --exclude '*\.md' -C $(pwd) && rm /tmp/"$GIT_REPONAME".tar.gz | |
} |