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 lang="en" ng-app="myApp"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>scope inheritance</title> | |
</head> | |
<body> | |
<h3>Controller Scope Inheritance</h3> | |
<!-- PARENT --> |
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
#!/usr/bin/env bash | |
apm_lazy_install() { | |
for package in $@; do | |
apm list | grep $package > /dev/null || | |
apm install $pacakge | |
done | |
} | |
apm_lazier_install() { |
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
pwd | tr -d '\n' | pbcopy |
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
#!/usr/bin/env bash | |
# Works partially with Symofny 2.5 | |
# Works fully with Symfony 2.3 — 2.4 | |
# Tested against Symfony: 2.5.0, 2.4.1, 2.3.9 | |
# Usage: | |
# symfony2_hello_world.sh <optional: project folder> <optional: symfony version> <optional: domain name> | |
# Examples: | |
# symfony2_hello_world.sh |
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
# assuming you have a root stylesheet like app/assets/stylesheets/application.scss you can easily generate all your import | |
# statements with a single line of BASH | |
# look in all of the sub-folders of app/assets/stylesheets/ for scss files | |
# find app/assets/stylesheets/*/* -name '*.scss' | |
# ignore the first 24 characters of the path (i.e. `app/assets/stylesheets/`) | |
# cut -c 24- | |
# create import statement for each file found | |
# awk '{print "@import \"" $1"\";"}' | |
# remove any distracting leading underscores from the filenames |
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
function makeProblems(count) { | |
var problems = []; | |
for (var i = 0; i < count; i++) { | |
var problematic = function(runId) { | |
console.log(runId + ' executed with i as: ' + i); // <-- `i` is bound to makeProblems scope | |
}; | |
problems.push(problematic); |
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
#!/usr/bin/env bash | |
if ! command -v gulp > /dev/null; then | |
echo && echo "error: gulp required" | |
exit 1 | |
fi | |
gulp build | |
if ! command -v md5sum > /dev/null; then |
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
_ | |
| |__ ___ ___ | |
| '_ \ / _ \/ _ \ | |
| |_) | __/ __/ | |
|_.__/ \___|\___| | |
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
grep 'ms' $LOG_FILE | awk '{print $(NF-0)}' | tr -d '()ms' | paste -sd+ - | bc |
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
<< DOC | |
Usae: | |
mage2_module_scaffold <vendor> <module> | |
Note: | |
This command is destructive — it will ovewrite app/code/<vendor>/<module>/etc/module.xml | |
DOC | |
mage2_module_scaffold() { | |
local vendor=$1 |