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 / array-to-comma-separated.js
Created June 10, 2016 12:51
Javascript - Turn array into comma-separated list
/**
* Turn array into comma-separated list
* @param {Array} list
* @return {String}
*/
const arrayToCommaSeparated = (list) => {
return list.join(', ');
};
@marioblas
marioblas / shp-to-geojson.sh
Last active August 29, 2015 14:18 — forked from ayozebarrera/geo.json
🌍 ogr2ogr - Get a GeoJSON with 4326 projection from a shapefile
# Get a geojson with 4326 projection from a shapefile
ogr2ogr -f GeoJSON -t_srs crs:84 name.geojson name.shp
# -f format_name: GeoJSON (ESRI Shapefile, GML, MapInfo file...)
# -t_srs: Reproject/transform to this SRS on output (crs:84 is WGS84)
@marioblas
marioblas / bash-cheatsheet.sh
Last active July 28, 2024 06:29 — forked from LeCoupa/bash-cheatsheet.sh
The ultimate bash cheatsheet
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@marioblas
marioblas / animation-transition-end.js
Last active August 29, 2015 14:12
jQuery - Detect the completion of an animation/transition
$('#foo').on('webkitAnimationEnd mozAnimationEnd animationend', function() {
// Do something after animation...
});
// Note: transitionend fires for each property transitioned!
// mozTransitionEnd?
// oTransitionEnd for old Opera
$('#bar').on('webkitTransitionEnd mozTransitionEnd otransitionend oTransitionEnd transitionend', function() {
// Do something after transition...
});
@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>
@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 / 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 / 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 / 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 / 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;
}