Skip to content

Instantly share code, notes, and snippets.

View gustavom's full-sized avatar

Gustavo Martusewicz gustavom

View GitHub Profile
@gustavom
gustavom / SassMeister-input.scss
Created November 1, 2016 10:44 — forked from akfzambrana/SassMeister-input.scss
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
$color-state-modifier: 10%;
@mixin state-color-changes($this-color, $properties...) {
@each $prop in $properties {
#{$prop}: $this-color;
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "scss"
images_dir = "imagens"
javascripts_dir = "javascripts"
# You can select your preferred output style here (can be overridden via the command line):
@gustavom
gustavom / filtro-valor-repetido-array.js
Created October 5, 2016 12:54
Filtragem de valores repetidos de um array, gerando um novo array
var arr = ['foo', 'bar', 'foo'];
var novaArr = arr.filter(function(este, i) {
return arr.indexOf(este) == i;
})
console.log(novaArr); //dá ['foo', 'bar']
@gustavom
gustavom / pure-prepend.js
Last active August 18, 2016 13:08
Prepend do Jquery em js puro
//define elemento container - com ID
var elementoContainer = document.getElementById("elementoContainerID");
//define elemento para ser inserido no inicio
var elementoParaInserir = document.createElement('div');
elementoParaInserir.classList.add('_elementoInserido');
elementoContainer.insertBefore(elementoParaInserir, elementoContainer.firstChild);
//eu vi aqui:
@gustavom
gustavom / closest.js
Last active May 6, 2016 18:50
Closest jquery
$(document).ready(function(){
$("span").closest("ul").css({"color": "red", "border": "2px solid red"});
});
/*
diferente do parent(), ele varre os elementos 'pai' até encontrar o definido;
No exemplo, a partir do elemento 'span', o js vai varrer os elementos pai, até achar uma 'ul'.
*/
@gustavom
gustavom / mixin.scss
Created May 5, 2016 21:01
mixin vertical align
@mixin vtal(){
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
@gustavom
gustavom / SassMeister-input.scss
Created June 2, 2015 20:02
Generated by SassMeister.com.
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
@for $i from 1 through 14 {
$altura_img: 360;
$largura_img: 980;
@gustavom
gustavom / SassMeister-input.scss
Created June 2, 2015 18:51
Generated by SassMeister.com.
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
@for $i from 1 through 980 {
$altura_img: 360;
$largura_img: 980;
$nova_largura_img: 980 - $i;
//AI / LI * NLI = NAI
@gustavom
gustavom / .gitignore
Last active August 29, 2015 14:13 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@gustavom
gustavom / gist:a7ae8710fcfd3af7aff8
Created January 20, 2015 20:09
GIT - para de rastrear arquivo
git rm --cached nome_do_arquivo