^ Negação \D - Tudo o que não for números \d - Tudo o que for números \w - Letras e '' \W - Tudo o que não for letras e ''
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative" | |
git config --global alias.st "status -sb" | |
git config --global alias.co "checkout" | |
git config --global alias.cm = "commit" | |
git config --global alias.ac = "!git add -A && git commit" | |
git config --global alias.st "status -sb" | |
git config --global alias.tags "tag -l" | |
git config --global alias.branches "branch -a" | |
git config --global alias.remotes "remote -v" |
(function(namespace, Handlebars) { | |
/** | |
* Retorna uma string no formato "uma-texto-a-ser-formatado" | |
* | |
* @param {String} text | |
* @param {Sttring} separador | |
* @return {String} | |
*/ | |
function slug(text, separator) { | |
var |
SetEnvIf Origin "^(.*\.example\.com)$" ORIGIN_SUB_DOMAIN=$1 | |
Header set Access-Control-Allow-Origin "%{ORIGIN_SUB_DOMAIN}e" env=ORIGIN_SUB_DOMAIN |
javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}funct |
##Introduction
One definition of unit testing is the process of taking the smallest piece of testable code in an application, isolating it from the remainder of your codebase and determining if it behaves exactly as expected. In this section, we'll be taking a look at how to unit test Backbone applications using a popular JavaScript testing framework called Jasmine.
For an application to be considered 'well'-tested, distinct functionality should ideally have its own separate unit tests where it's tested against the different conditions you expect it to work under. All tests must pass before functionality is considered 'complete'. This allows developers to both modify a unit of code and it's dependencies with a level of confidence about whether these changes have caused any breakage.
As a basic example of unit testing is where a developer may wish to assert whether passing specific values through to a sum
function results in the correct output being returned. For an example more relevant to this book,
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
# Setup a better visual information at terminal line | |
HOST='\[\033[02;36m\]\h'; HOST=' '$HOST | |
TIME='\[\033[01;31m\]\t \[\033[01;32m\]' | |
LOCATION=' \[\033[01;34m\]`pwd | sed "s#\(/[^/]\{1,\}/[^/]\{1,\}/[^/]\{1,\}/\).*\(/[^/]\{1,\}/[^/]\{1,\}\)/\{0,1\}#\1_\2#g"`' | |
BRANCH=' \[\033[00;33m\]$(git_branch)\[\033[00m\]\n\$ ' | |
PS1=$TIME$USER$HOST$LOCATION$BRANCH | |
PS2='\[\033[01;36m\]>' | |
# Automplete for linux commands | |
if [ -f /etc/bash_completion ]; then |
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/ | |
git clone git://github.com/wbond/sublime_package_control.git Package\ Control | |
cd Package\ Control | |
git checkout python3 | |
# restart Sublime Text 3 and you should have Package Control working |
// Generate unique IDs for use as pseudo-private/protected names. | |
// Similar in concept to | |
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>. | |
// | |
// The goals of this function are twofold: | |
// | |
// * Provide a way to generate a string guaranteed to be unique when compared | |
// to other strings generated by this function. | |
// * Make the string complex enough that it is highly unlikely to be | |
// accidentally duplicated by hand (this is key if you're using `ID` |