Skip to content

Instantly share code, notes, and snippets.

View marioblas's full-sized avatar
🏠
Working from home

Mario Blas Gil Cárdenes marioblas

🏠
Working from home
View GitHub Profile
@marioblas
marioblas / git-cheat-sheet.sh
Last active March 22, 2017 11:32
🔀 Git cheat sheet
###############################################################################
# EMPEZANDO ###################################################################
###############################################################################
# Configurar email y nombre
git config --global user.name "John Doe"
git config --global user.email "foobarbaz@gmail.com"
# Crear un nuevo repositorio
git init
@marioblas
marioblas / bootstrap-3-media-queries.css
Last active November 20, 2019 16:51
CSS - Bootstrap 3 Media Queries
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
@marioblas
marioblas / conditional-media-query-mixin.scss
Last active August 29, 2015 14:05
SCSS - Conditional Media Query Mixin
/**
* 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
@marioblas
marioblas / 256-colors.sh
Last active August 29, 2015 14:05
🎨 Prompt colors
#!/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
@marioblas
marioblas / box-sizing.css
Created October 5, 2014 15:49
CSS - Inheriting box-sizing Probably Slightly Better Best-Practice
/**
* Inheriting box-sizing Probably Slightly Better Best-Practice.
* This will give you the same result, and make it easier to change the box-sizing in plugins or other components that leverage other behavior.
*
* Reference: http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
*/
html {
box-sizing: border-box;
}
@marioblas
marioblas / user-select.css
Last active April 12, 2016 09:14
CSS - Disable text selection highlighting
/**
* Disable text selection highlighting.
*
* Reference: http://stackoverflow.com/questions/826782/css-rule-to-disable-text-selection-highlighting
*/
.no-select {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
@marioblas
marioblas / generate-ssh-key.sh
Last active March 29, 2016 18:58
🔐 Generating SSH keys
# References:
# https://help.github.com/articles/generating-ssh-keys/
# https://help.github.com/articles/working-with-ssh-key-passphrases/
###############################################################################
# 1. Check for SSH keys
###############################################################################
# List the files in your .ssh directory, if they exist
ls -al ~/.ssh
@marioblas
marioblas / sublime-text-cheat-sheet.md
Last active August 29, 2015 14:10
Sublime Text cheat sheet

Sublime Text cheat sheet

General

Command Description
⌘⇧P Command palette
⌘KB Show/hide sidebar
⌃0 Focus on sidebar
@marioblas
marioblas / aspect-ratio.css
Last active August 29, 2015 14:10 — forked from ayozebarrera/ratio.css
CSS - Aspect ratio 16:9
.aspect-ratio {
display: block;
height: 0; /* we have padding-bottom instead height (content + padding - bottom) */
padding-bottom: 56.25%; /* 16:9 ratio -> (9 ÷ 16) × 100 = 56.25 */
overflow: hidden;
}
@marioblas
marioblas / detect-ie-version.html
Last active August 29, 2015 14:11
HTML/SCSS/Javascript - Detect IE version
<!doctype html>
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]-->
<head>