See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| beforeEach(async(() => { | |
| TestBed.configureTestingModule({ | |
| imports: [ | |
| MdToolbarModule, | |
| ], | |
| providers: [ | |
| { | |
| provide: Router, | |
| useClass: MockRouter, | |
| }, |
| # Pass the env-vars to MYCOMMAND | |
| eval $(egrep -v '^#' .env | xargs) MYCOMMAND | |
| # … or ... | |
| # Export the vars in .env into your shell: | |
| export $(egrep -v '^#' .env | xargs) |
| docker logs nginx 2>&1 | grep "127." | |
| # ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container |
| # Redis Cheatsheet | |
| # All the commands you need to know | |
| redis-server /path/redis.conf # start redis with the related configuration file | |
| redis-cli # opens a redis prompt | |
| # Strings. |
| var elastic = require('elasticsearch'); | |
| var client = new elastic.Client({ host: 'localhost:9200' }); | |
| var index = 'myindex'; | |
| var type = 'document'; | |
| (function init() { | |
| Promise.resolve() | |
| .then(deleteIndex, handleError) |
| package union | |
| /** | |
| * Much magic. Very Lambda. Wow! | |
| * | |
| * These types provide union types (i.e. val a = (String or Int) within Scala. See here for good discussion on | |
| * how to represent union types in Scala (hat tip Miles Sabin) | |
| * http://stackoverflow.com/a/37450446/1591351 | |
| * | |
| * Core idea is to adapt Demorgan's Law: |
| /** | |
| * @license | |
| * Copyright (c) 2019 Jonathan Catmull. | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is | |
| * furnished to do so, subject to the following conditions: |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| ) | |
| func main() { | |
| // We need to cast handleRoot to a http.HandlerFunc since wrapHandlerWithLogging |