Commands to get commit statistics for a Git repository from the command line -
using git log
, git shortlog
and friends.
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
<?php | |
namespace Your\Module; | |
class Example | |
{ | |
/** | |
* @var Helper\Translation | |
*/ | |
private $translation; |
This file contains hidden or 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
<?php | |
// Context: I'm trying to argue that DI (and DIC) are great, and DIC libs suck. | |
// Happy to be proven wrong! | |
final class Router { | |
private $dependencies; | |
public function __construct (Dependencies $dependencies) { | |
$this->dependencies = $dependencies; | |
// You might say that this is Service Locator, but it's not. This router is toplevel, | |
// and toplevel must have access to dependencies. After that it can all just bubble nicely using proper DI. |
This file contains hidden or 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
{ | |
"editor.formatOnSave": true, | |
// Enable per-language | |
"[javascript]": { | |
"editor.formatOnSave": true, | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[json]": { | |
"editor.formatOnSave": true, | |
"editor.defaultFormatter": "esbenp.prettier-vscode" |
This file contains hidden or 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 os = require("os"); | |
const { promisify } = require("util"); | |
const exec = promisify(require("child_process").exec); | |
const temptdir = os.tmpdir(); | |
if (fs.existsSync(`${temptdir}/@magento`)) { | |
fs.rmdirSync(`${temptdir}/@magento`, { recursive: true }); |