Skip to content

Instantly share code, notes, and snippets.

View arkaitzgarro's full-sized avatar

Arkaitz Garro arkaitzgarro

View GitHub Profile
@arkaitzgarro
arkaitzgarro / safari-nomodule.js
Last active January 9, 2018 21:24 — forked from samthor/safari-nomodule.js
Safari 10.1 `nomodule` support
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.:
* <script nomodule>alert('no modules');</script>.
*
* This workaround is possible because Safari supports the non-standard 'beforeload' event.
* This allows us to trap the module and nomodule load.
@arkaitzgarro
arkaitzgarro / .gitconfig
Last active March 7, 2017 09:13
Github aliases
[alias]
st = status
co = checkout
ec = config --global -e
# You Only Live Once
yolo = push --force --no-verify
# Update form origin without loosing changes
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
# Create a new branch
cob = checkout -b
@arkaitzgarro
arkaitzgarro / .sublime-keymap
Last active July 11, 2017 12:38
Sublime Tex 3 configuration
[
{ "keys": ["super+shift+o"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{ "keys": ["super+shift+up"], "command": "swap_line_up" },
{ "keys": ["super+shift+down"], "command": "swap_line_down" },
{ "keys": ["super+alt+down"], "command": "goto_definition" },
{ "keys": ["super+backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
]
@arkaitzgarro
arkaitzgarro / mappings.yml
Created January 16, 2015 18:22
Extend Elcodi entities
elcodi_configuration:
mapping:
configuration:
class: QBH\StoreConfigurationBundle\Entity\Configuration
mapping_file: @StoreConfigurationBundle/Resources/config/doctrine/Configuration.orm.yml
elcodi_currency:
mapping:
currency:
class: QBH\StoreCurrencyBundle\Entity\Currency
@arkaitzgarro
arkaitzgarro / index.html
Created November 16, 2014 16:36
HTML5 Boilerplate
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Plantilla HTML5</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/normalize.css">
@arkaitzgarro
arkaitzgarro / DOM selector
Created November 16, 2014 10:03
DOM selector
var $ = function(selector) {
var elems;
// TODO: attach to Element prototipe
elems = document.querySelectorAll(selector);
if (elems && elems.length === 1) {
return elems[0];
} else if (elems && elems.length > 1) {
return elems;
}