Skip to content

Instantly share code, notes, and snippets.

View joseadrian's full-sized avatar

Joseadrian Ochoa joseadrian

View GitHub Profile
@joseadrian
joseadrian / analytics.ajax.html
Last active May 11, 2016 03:26
Registro de evento o página para obtener conteo de registrados utilizando Google Analytics
<!--
Ejemplo:
Página: dominio/formulario
API: analytics.js
-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@joseadrian
joseadrian / reset.sass
Created April 4, 2016 17:43 — forked from trey/reset.sass
Eric Meyer's reset.css in Sass. Originally by @postpostmodern.
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain) */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
@joseadrian
joseadrian / lstofile.sh
Created January 28, 2014 03:11
List files into a file text

The -R flag drills recursively into sub folders.

The -F flag writes a trailing slash '/' after folders, and a trailing asterisk '*' after executable files.

Source

@joseadrian
joseadrian / canvas_url.php
Last active December 31, 2015 15:49
Facebook Comments
<!--
This file is the Canvas URL
It's generated automatically
-->
<head>
<meta charset="UTF-8" />
<title>Title</title>
<meta property="fb:app_id" content="474221426024929" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Title"/>
<?php
// https://github.com/GerHobbelt/nicejson-php/blob/master/nicejson.php
// original code: http://www.daveperrett.com/articles/2008/03/11/format-json-with-php/
// adapted to allow native functionality in php version >= 5.4.0
/**
* Format a flat JSON string to make it more human-readable
*
#banner {
border: 1px solid #666;
display: block;
width: 100%;
height: 1em;
font-size: 1em;
line-height: 1em;
margin: 20px auto;
padding: 0px;
text-align: justify;
@joseadrian
joseadrian / first-example.js
Last active December 29, 2015 15:59
jQuery Lines examples
$('.first').lines({
replace: function(lines) {
var lastLine = lines[lines.length-1];
var center = $(this).width()/2 - lastLine.width/2;
lines[lines.length-1].text = '<span style="position:relative;margin-left:'+center+'px">'+lastLine.text+'</span>';
return lines;
}
});
@joseadrian
joseadrian / computedStyle.js
Created November 27, 2013 21:22
getComputeStyle IE support. getcomputedStyle(element, pseudo class)
// http://stackoverflow.com/questions/15733365/cross-browser-ie8-getcomputedstyle-with-javascript#comment23187887_15733365
// http://snipplr.com/view/13523/
if (!window.getComputedStyle) {
window.getComputedStyle = function(el, pseudo) {
this.el = el;
this.getPropertyValue = function(prop) {
var re = /(\-([a-z]){1})/g;
if (prop == 'float') prop = 'styleFloat';
if (re.test(prop)) {
prop = prop.replace(re, function () {
@joseadrian
joseadrian / less.js
Created November 25, 2013 23:27
Crear funciones lesscss
less = {
functions: {
test: function(value, context){
// return new(tree.Dimension)(valor, unidad)
// return new(tree.Anonymous)
// return new(tree.Quoted)
// return new(tree.URL)
// return new(tree.color)(color, alpha)
}
}
@joseadrian
joseadrian / googlemaps.polyline.event.js
Created November 14, 2013 15:08
Google Maps: Polyline point events: dragStart and dragEnd
google.maps.event.addListener(myPolyline, 'capturing_changed', function(e) {
var path = this.getPath();
});