Skip to content

Instantly share code, notes, and snippets.

View fdorantesm's full-sized avatar

Fernando Dorantes fdorantesm

View GitHub Profile
@fdorantesm
fdorantesm / README.md
Created June 13, 2018 15:11 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@fdorantesm
fdorantesm / form-shortcut-submit.js
Created June 4, 2018 19:36
Submit forms with ctrl/cmd + enter
window.addEventListener('load', function(){
forms = document.getElementsByTagName('form')
for (form of forms) {
form.addEventListener('keydown', function(e) {
if (e.keyCode == 13 && e.metaKey) {
$button = form.querySelector('button[type="submit"]')
$button.click()
return false
}
})
@fdorantesm
fdorantesm / media.sass
Last active April 22, 2018 15:38
Media query sass mixin helper
$screen-xs-max: 480px
$screen-sm-min: 481px
$screen-sm-max: 960px
$screen-md-min: 961px
$screen-md-max: 1280px
$screen-lg-min: 1281px
@mixin xs($max-width: true)
@if $max-width
@media only screen and (max-width: $screen-xs-max)
@fdorantesm
fdorantesm / flexbox.css
Last active April 22, 2018 05:41
Grid generator sass mixin
.col {
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
-ms-flex-preferred-size: 0;
flex-basis: 0;
max-width: 100%;
}
.start-xs {
@fdorantesm
fdorantesm / classes.css
Last active April 22, 2018 04:58
Loop classes generator with sass
.p0 {
padding: 0px;
}
.p5 {
padding: 5px;
}
.p10 {
padding: 10px;
@fdorantesm
fdorantesm / maps.html
Created March 14, 2018 17:53
Google maps
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div id="yo" style="width: 480px; height:320px;"></div>
<div id="taq" style="width: 480px; height:320px;"></div>
<div id="genotipo" style="width: 480px; height:320px;"></div>
<script src="maps.js"></script>
@fdorantesm
fdorantesm / map.geojson
Last active October 12, 2017 15:28
Geocerca de Tepatitlán de Morelos
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fdorantesm
fdorantesm / map.geojson
Last active October 3, 2017 19:34
Geofence Yapp Querétaro
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fdorantesm
fdorantesm / Queretaro.geojson
Last active October 3, 2017 15:15 — forked from anonymous/map.geojson
Queretaro metropolitan area
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fdorantesm
fdorantesm / err.json
Created August 12, 2017 22:47
Mongoose duplicated key
{
"status": 400,
"message": "insertDocument :: caused by :: 11000 E11000 duplicate key error index: morado.properties.$cert_1 dup key: { : \"predial2.pdf\" }",
"data": {
"code": 11000,
"index": 0,
"errmsg": "insertDocument :: caused by :: 11000 E11000 duplicate key error index: morado.properties.$cert_1 dup key: { : \"predial2.pdf\" }",
"op": {
"updatedAt": "2017-08-12T22:43:06.593Z",
"createdAt": "2017-08-12T22:43:06.593Z",