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/bash | |
# Generates an 8 bit color table (256 colors) for reference, | |
# using the ANSI CSI+SGR \033[48;5;${val}m for background and | |
# \033[38;5;${val}m for text (see "ANSI Code" on Wikipedia) | |
# | |
# Reference: http://web.archive.org/web/20131009193526/http://bitmote.com/index.php?post/2012/11/19/Using-ANSI-Color-Codes-to-Colorize-Your-Bash-Prompt-on-Linux | |
echo -en "\n + " | |
for i in {0..35}; do |
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
/** | |
* Conditional Media Query Mixin. | |
* Usage: @include media(xs) { ... }, @include media(sm) { ... }, ... | |
* | |
* Other elegant and nice solutions: | |
* http://css-tricks.com/approaches-media-queries-sass | |
* | |
* The best solution to get total control of the conditions: | |
* https://github.com/eduardoboucas/include-media | |
* http://davidwalsh.name/sass-media-query |
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
/*================================================== | |
= Bootstrap 3 Media Queries = | |
==================================================*/ | |
/*========== Mobile First Method ==========*/ | |
/* Custom, iPhone Retina */ | |
@media only screen and (min-width : 320px) { | |
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
############################################################################### | |
# EMPEZANDO ################################################################### | |
############################################################################### | |
# Configurar email y nombre | |
git config --global user.name "John Doe" | |
git config --global user.email "[email protected]" | |
# Crear un nuevo repositorio | |
git init |
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
/** | |
* Check if a user has scrolled to the bottom. | |
* | |
* Source: http://stackoverflow.com/questions/3898130/how-to-check-if-a-user-has-scrolled-to-the-bottom | |
*/ | |
$(window).scroll(function() { | |
if( $(window).scrollTop() + $(window).height() == $(document).height() ) { | |
console.log("bottom!"); | |
} | |
}); |
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
/** | |
* Write data-* attribute and get it. | |
* | |
* When you make a call to .data, jQuery looks for any data-* attributes, and adds it to the data collection. | |
* However, THIS ONLY HAPPENS ONCE. Subsequent calls to .data will not look at the element's data-* attributes. | |
* | |
* Source: http://stackoverflow.com/questions/12271362/writing-to-a-data-attribute-and-getting-it-with-jquery-data/12271393#12271393 | |
* Related and very important: http://stackoverflow.com/questions/7261619/jquery-data-vs-attr#7262427 | |
*/ | |
$('.foo').attr('data-bar', 'baz'); |
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
/** | |
* Truncate String with Ellipsis. | |
* | |
* Source: http://css-tricks.com/snippets/css/truncate-string-with-ellipsis/ | |
*/ | |
.truncate { | |
width: 250px; | |
white-space: nowrap; | |
overflow: hidden; | |
text-overflow: ellipsis; |
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
/** | |
* Get the last class of an element | |
*/ | |
var lastClass = $('.foo').attr('class').split(' ').pop(); |
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
/** | |
* Hace mas amigable la lectura de una lista de elementos separados por punto | |
* | |
* Ejemplos: | |
* | |
* HTML.CSS.Javascript.Node. | |
* --> HTML, CSS, Javascript y Node. | |
* | |
* HTML. | |
* CSS. |
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
/** | |
* Remove spaces from a string. | |
* | |
* Info: http://stackoverflow.com/questions/5963182/how-to-remove-spaces-from-a-string-using-javascript | |
*/ | |
str = str.replace(/\s+/g, ''); | |
/** | |
* In the first regex, each space character is being replaced, character by character, with the empty string. | |
* In the second regex, each contiguous string of space characters is being replaced with the empty string because of the +. |