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
** Look arounds ** | |
Positive lookahead: q(?=u) // find q followed by u | |
Negative lookahead: q(?!u) // find q not followed by u | |
Positive lookbehind: (?<=a)b // find b preceeded by a. CANNOT BE VARIBLE LENGTH | |
Negative lookbehind: (?<!a)b // find b not preceeded by a. CANNOT BE VARIBLE LENGTH | |
** Atomic grouping ** | |
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
for(var i = 0, len = localStorage.length; i < len; i++){ | |
var key = localStorage.key(i); | |
var value = localStorage[key]; | |
} |
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
$eminpx:14; | |
@function pxtoem($target, $context:$eminpx){ | |
@return #{$target/$context}em; | |
} | |
@function emtopx($target, $context:$eminpx){ | |
@return #{$target*$context}px; | |
} |
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"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HTML download attribute</title> | |
</head> | |
<body> | |
<ul> | |
<li><a href="downloadable-file.txt">View your invoice</a></li> | |
<li class="download"><a href="downloadable-file.txt">Right-click and select Save to download your invoice</a></li> |
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
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<script>window.jQuery || document.write("<script src='URL'>\x3C/script>")</script> |
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 sizeSelects(){ | |
var fs = window.getComputedStyle(document.querySelector("body"),null).getPropertyValue("font-size").slice(0,-2); | |
var selects = document.querySelectorAll("select"); | |
for (var select = 0; select < selects.length; select++){ | |
var opts = selects[select].querySelectorAll("option"); | |
var len = 0; | |
var longest = 0; |
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
# Useful Git commands | |
## Config Options | |
git config --global user.name "First Last" | |
git config --global user.email "emailaddress" | |
git config user.email "emailaddress" : sets email address for a repo instead of globally | |
git config user.email : shows which email address it is using in the repo you're currently in | |
git config --global core.editor emacs : should you want to specifiy an editor for interactive commands See [associating text editors with Git](https://help.github.com/articles/associating-text-editors-with-git/) for more options | |
git config --global merge.tool opendiff : specify a merge tool (OSX only) |
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
1. Split each word onto it's on line (use text editor until bash command can be found) | |
2. Strip out things like speech marks, brackets, full stops, commas, slashes, dashes, etc | |
3. `awk '{print tolower($0)}' filename | sort > outputfilename` |
OlderNewer