This file contains hidden or 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
| /* | |
| * Pode ser usado o elmento pai do elemento que você quer manipular ou então usar o body | |
| */ | |
| // live() for Jquery >= 1.7 | |
| $('body').on('hover','.ElementoAlvo',function(){ | |
| //... | |
| }); | |
This file contains hidden or 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/sh | |
| npm uninstall npm -g | |
| ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
| brew install node | |
| npm install -g yeoman | |
| npm install -g yo generator-generator |
This file contains hidden or 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
| // If URL is http://www.somedomain.com/account/search?filter=a#top | |
| window.location.pathname // /account/search | |
| // For reference: | |
| window.location.host // www.somedomain.com (includes port if there is one) | |
| window.location.hostname // www.somedomain.com | |
| window.location.hash // #top | |
| window.location.href // http://www.somedomain.com/account/search?filter=a#top |
This file contains hidden or 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
| class StringSearch | |
| { | |
| static void Main() | |
| { | |
| string str = "A silly sentence used for silly purposes."; | |
| System.Console.WriteLine("'{0}'",str); | |
| bool test1 = str.StartsWith("a silly"); | |
| System.Console.WriteLine("starts with 'a silly'? {0}", test1); |
This file contains hidden or 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
| module.exports = function(grunt) { | |
| // Project configuration. | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| uglify: { | |
| // options: { | |
| // banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' |
This file contains hidden or 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
| rvm use system;rvm gemset export system.gems;rvm use 1.9.3;rvm gemset import system.gems |
This file contains hidden or 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
| // Example: | |
| JavaScript.load("/javascripts/something.js"); | |
| // With callback (that’s the good thing): | |
| JavaScript.load("http://www.someawesomedomain.com/api.js", function() { | |
| API.use(); // or whatever api.js provides ... | |
| }); |
This file contains hidden or 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
| clear | |
| echo "Installing PHP environment..." | |
| echo "---" | |
| apt-get install php5-cli php5-cgi php5-common php5-curl php5-dev php5-gd php5-mcrypt php5-mhash | |
| apt-get install php5-mysql libmysqld-dev | |
| apt-get install php5-fpm | |
| echo "---" | |
| echo "Installing Ruby environment + NGINX..." | |
| echo "---" |
This file contains hidden or 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
| // JavaScript Document | |
| // adiciona mascara para rg | |
| // Cada estado têm regras e quantidades diferentes de números no registro. Por isso, | |
| // não há uma maneira confiável de fazer a validação do mesmo. | |
| function MascaraRg(v0,errChar='?'){ | |
| const v = v0.toUpperCase().replace(/[^\dX]/g,''); | |
| return (v.length==8 || v.length==9)? | |
| v.replace(/^(\d{1,2})(\d{3})(\d{3})([\dX])$/,'$1.$2.$3-$4'): | |
| (errChar+v0) |
This file contains hidden or 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 CarrinhoFlutuante = { | |
| getProductImage: function(product_id,element_to_insert){ | |
| $.ajax({ | |
| url: '/produto/sku/'+product_id, | |
| type: 'get', | |
| dataType: 'json', | |
| success: function(data, textStatus, xhr) { | |
| var image_path = data[0].Images[0][0].Path; |