Skip to content

Instantly share code, notes, and snippets.

View frankitox's full-sized avatar

Franco Biasin frankitox

  • Rosario, Argentina
View GitHub Profile
@frankitox
frankitox / prepare-commit-msg
Last active February 19, 2020 15:11
Git hook to prepend Jira ticket code.
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD | grep -Po '[A-Z]{4}-[0-9]{4,5}')
BRANCH_NAME="${BRANCH_NAME##*/}"

Static/dynamic, strong/weak typing.

You have discovered a soft spot in the terminology that amateurs use to talk about programming languages. Don't use the terms "strong" and "weak" typing, because they don't have a universally agreed on technical meaning. By contrast, static typing means that programs are checked before being executed, and a program might be rejected before it starts. Dynamic typing means that the types of values are checked during

@frankitox
frankitox / addEventListener.js
Last active August 29, 2015 13:56
Cross-Browser event attach handler
// Crossbrowser event attacher.
var addEventListener = function (elem, evento, handler) {
console.assert(elem.addEventListener || elem.attachEvent, "Can't find an event handler.");
if (elem.addEventListener) {
elem.addEventListener(evento, function (e) {
if (handler.call(elem, e) === false)
e.preventDefault();
});
} else if (elem.attachEvent) {
elem.attachEvent('on' + evento, function (e) {