#Javascript Project Setup/Docs
##Stuff Covered Here
- Webpack
- Express
- Mocha
- Chai
- Lodash
<!--- content with header application/json comes through as binary ---> | |
<cfoutput> | |
#toString(getHttpRequestData().content)# | |
</cfoutput> |
#!/bin/bash | |
if [ ! -d "specs" ]; then | |
mkdir "specs" | |
fi | |
for file in *.rb | |
do | |
echo "require('minitest/autorun')" >> "specs/${file/.rb/}"_spec.rb |
# First off, a parent has no idea about a child, it's behaves as if it doesn't exist | |
# calling a method "super" inside of a class that inherits from another class, will call | |
# that same method it is inside, in the parent (with the arguments you pass to it) | |
# so in this case, in the child, it calls the initialize() method from the parent. | |
# It's important to realise that you still have a object of the child class, so despite | |
# the names I gave them, @parent_var_one and @parent_var_two are actually instance variables | |
# for your Child class and all behaviours/methods inside of Parent are carried down into (but | |
# can be overwritten by) Child. | |
class Parent |
class myClass | |
# [initialize with instance variable assignments] | |
def to_hash | |
return Hash[self.instance_variables.map{|var_name| [var_name.to_s.delete("@"), eval(var_name.to_s)]}] | |
end | |
end |
#Javascript Project Setup/Docs
##Stuff Covered Here
// prints out all links on the page, in alphabetical order with duplicates removed | |
(function () {console.table([].map.call(document.querySelectorAll('a'), function (a) {return a.hostname}).filter( | |
function (h,i,s) {return s.indexOf(h) === i}).sort()) | |
}()) |
cd
into a deliveroo repo directorycurl -s https://gist.githubusercontent.com/scott-ad-riley/0d774a70452bd5bb118638b7dbed0176/raw/dde71f9489f2d01a6f048ec58d6f7f4cf93f63ce/prepare-commit-msg.rb > ./.git/hooks/prepare-commit-msg
./git/hooks/prepare-commit-msg
fileN.B. It currently throws and prevents you from committing if your commit message starts with a different ticket number to the branch you're on (i.e. if you pass it PAY-1234: some message and you're on a branch that doesn't start PAY-1234/...
)