Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (c) 2011, Yahoo! Inc. All rights reserved.
* Copyright (c) 2011-2012, Log-Normal, Inc. All rights reserved.
* Copyright (c) 2012-2016, SOASTA, Inc. All rights reserved.
* Copyrights licensed under the BSD License. See the accompanying LICENSE.txt file for terms.
*/
/* JavaScript MD5 1.0.1 Copyright 2011, Sebastian Tschan. Licensed under the MIT license. */
/* Boomerang Version: 1.0.1503526070 */
function BOOMR_check_doc_domain(a){if(window){if(!a){if(window.parent===window||!document.getElementById("boomr-if-as"))return;if(window.BOOMR&&BOOMR.boomerang_frame&&BOOMR.window)try{BOOMR.boomerang_frame.document.domain!==BOOMR.window.document.domain&&(BOOMR.boomerang_frame.document.domain=BOOMR.window.document.domain)}catch(b){BOOMR.isCrossOriginError(b)||BOOMR.addError(b,"BOOMR_check_doc_domain.domainFix")}a=document.domain}if(-1!==a.indexOf(".")){try{window.parent.document;return}catch(b){document.domain=a}try{window.parent.document;return}catch(b){a=a.replace(/^[\w\-]+\./,"")}BOOMR_check_d
@avilaj
avilaj / 0_reuse_code.js
Created July 12, 2017 23:41
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@avilaj
avilaj / index.html
Last active July 13, 2017 00:12 — forked from robschmuecker/README.md
Trying to do some cell
<!DOCTYPE html>
<style type="text/css">
</style>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<body>
<script src="https://rawgit.com/intercellular/cell/plan/cell.js"></script>
<script async src="zapp.js"></script>
@avilaj
avilaj / server-validation.component.js
Last active February 16, 2017 17:19
AngularJS Server-side validation directive
/*
* Let’s assume that the server returns validation errors using
* the following format:
*
* [{
* "field": "code",
* "type": "unique",
* "value": 123,
* "message": "this field is unique"
* }]
@avilaj
avilaj / wyiwyg.php
Last active June 11, 2016 10:57
Sleeping Owl Admin editor configuration
<?php
AdminFormElement::wysiwyg('page_content', 'Page Content')
->setParameters([
"toolbar" => [
[
"name" => "basicstyles",
"items" => [ "Bold", "Italic", "-", "RemoveFormat" ]
]
]
]);
@avilaj
avilaj / rems.styl
Last active December 17, 2015 23:49
Stylus rems converter with fallback I haven't tested it very much. License MIT
// License MIT
// Author: Jorge Avila <jorge.e.avila@gmail.com>
// Example:
// body
// -rems('margin', 10 20 30 40)
basefont = 16px
-rems(property, sizes)
rems = new array()
pixs = new array()
#! /bin/bash
# Vigila cambios en archivos coffe y stylus y los compila
# Se debe iniciar en el directorio padre de las dos carpetas
# Osea si el archivo se encuentra en proyecto/estaticos/coffe
# Se debe iniciar en proyecto/estaticos/
function notify {
notify-send -i applications-development -t 500 "Compilado!" $1
echo $1
}
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
for i in ~/.scripts/*.sh; do
. "$i"
done
@avilaj
avilaj / foursquare_leaflet_layer.js
Last active March 12, 2019 09:54
This is an attempt to make the foursquare layer implementation for leafletjs
/**
* @author Jorge Avila <jorge.e.avila@gmail.com>
* @license Mit
* @description Adds a padding to one side of the layer, like foursquare does.
*/
// i use the nwtjs library to get the element and height
// you can modify it to use jquery or whatever... instead
updateExtended = function () {