- only relevant files/changes are staged
- imperative tone is used without past tense
- type is referenced by the first word:
--
feat
: a new feature --fix
: a bug fix --docs
: changes to documentation --style
: formatting, missing semi colons, etc; no code change --refactor
: refactoring production code --test
: adding tests, refactoring test; no production code change --chore
: updating build tasks, package manager configs, etc; no production code change
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
set theDate to current date | |
=> date object | |
set theDate to current date as string | |
=> Thursday, December 03, 2015 at 09:57:25 | |
set theDate to current date | |
set y to rich text -4 thru -1 of ("0000" & (year of theDate)) | |
set m to rich text -2 thru -1 of ("00" & ((month of theDate) as integer)) | |
set t to rich text -2 thru -1 of ("00" & (day of theDate)) |
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
# Format Current Date | |
date +%Y-%m-%d\ %H:%M:%S | |
# Reformatting string date | |
# most distros | |
date -d'27 JUN 2011' +%Y%m%d | |
# => 20110627 | |
# os x / BSD | |
date -jf "%m %d %Y" "07 08 1990" +%Y-%m-%d | |
# => 1990-07-08 |
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> | |
<head> | |
<title>Title of your document</title> | |
<meta charset="utf-8"> | |
<meta name="description" content="description of your document"> | |
</head> | |
<body> |
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
#!/bin/bash | |
# prepend creation date to file names in format `YYY-MM-DD original_file_name` | |
for file in *; do | |
thedate=$(date -r $(stat -f %B "$file") +%Y-%m-%d) | |
echo "renaming \"$file\" to \"$thedate $file\"" | |
mv -v "$file" "$thedate $file" | |
done |
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
var detectDevices = { | |
iOS: function() { | |
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; | |
}, | |
Safari: function() { | |
return !!navigator.userAgent.match(/safari/i) && !navigator.userAgent.match(/chrome/i) && typeof document.body.style.webkitFilter !== "undefined" && !window.chrome; | |
} | |
} |
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
# log output of a command to a file while still viewing it in the shell | |
command | tee /dev/tty | >> file.log |
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
// map keyboard codes to their actual key value | |
var keyCodeMap = { | |
48: "0", | |
49: "1", | |
50: "2", | |
51: "3", | |
52: "4", | |
53: "5", | |
54: "6", | |
55: "7", |
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
# extract html comments from files in current working directory recursively | |
from bs4 import BeautifulSoup, Comment | |
import os | |
# run the following commands to install dependencies (OS X): | |
# easy_install beautifulsoup4 | |
# easy_install lxml |
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
<!-- make elemment really annoying to copy paste --> | |
<div class="unselectable" unselectable="on" onmousedown="return false;" onclick="return false;" ondragstart="return false;" onselectstart="return false;" style="-moz-user-select: none; cursor: default;"> | |
</div> |