Skip to content

Instantly share code, notes, and snippets.

View baamenabar's full-sized avatar
:octocat:
yeah, that

B. Agustín Amenábar Larraín baamenabar

:octocat:
yeah, that
View GitHub Profile
@baamenabar
baamenabar / index.html
Last active December 19, 2015 09:49
Simple accesible tooltip class - An anchor with a span inside, behaves well with tab navigation and screen readers. A CodePen by Agustín Amenabar.
<h1>Hellô Töòltip</h1>
<p>Here we have some unimportant information. <a href="#">Our company</a> provides solutions to the needs and requirements of our clients.</p>
<p>
<a href="javascript:;" class="tooltip-minimum">?<span>Sure, just hover or tab to this anchor tag and you'll see a tooltip apear.</span></a>
Might this require more explanation.
<a href="javascript:;" class="tooltip">?<span>Sure, just hover or tab to this anchor tag and you'll see a tooltip apear.</span></a>
</p>
@baamenabar
baamenabar / index.html
Created July 5, 2013 16:16
A CodePen by Agustín Amenabar. Simple accesible tooltip class - For an anchor with a span inside, behaves well with tabbed navigation.
<h1>Hellô Töòltip</h1>
<p>Here we have some unimportant information. <a href="#">Our company</a> provides solutions to the needs and requirements of our clients.</p>
<p><a href="javascript:;" class="tooltip">?<span>Sure, just hover or tab to this anchor tag and you'll see a tooltip apear.</span></a> This might require more explanation.</p>
@baamenabar
baamenabar / FLVPlayback loop
Created June 8, 2013 23:29
How to do a loop or looping video using the FLVplayback with AS3
import fl.video.VideoEvent;
fl_video.autoRewind = true; // fl_video being the name of the video component
fl_video.addEventListener(VideoEvent.AUTO_REWOUND, doLoop);
function doLoop(e:VideoEvent):void
{
e.target.play();
}
@baamenabar
baamenabar / getElementByClass.js
Created November 6, 2012 19:00
Dustin Diaz's get element by class JS function
/*
taken from http://www.dustindiaz.com/top-ten-javascript
*/
function getElementsByClass(searchClass,node,tag) {
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
@baamenabar
baamenabar / PagoWebPay.php
Created August 7, 2012 21:53
Clase de pago de webpay
<?php
/*
Class PagoWebPay
Versión: 0.1
Autor: Agustín Amenabar, @baamenabar (es) @ImINaBAR (en)
Licencia: MIT
parámetros:
$rdb: instancia de un objeto PDO ya inicializado, en su defecto, la clase se conectará sola, si es que se entregan los datos de conexión en el parámetro $configuracionClase.
$carpetaCGI : Dirección de carpeta CGI de transbank. Es importante dar la dirección correcta en cada instanciación, a veces uno tiene scripts en diferentes direcciones relativas con respecto a la carpeta CGI.
/**
* Localstorage for webfonts
* WIP
*
* This file should me minified/uglified and injected directly on the head.
* also absolute path to the static server should be used for the css files that get ajaxed.
*/
(function () {
'use strict';
// once cached, the css file is stored on the client forever unless
/**
* This is a simple list of ES5 JS polyfills and snippets I commonly need to add to code for it to run on IE8 or legacy JS engines.
* No particular order.
*/
// Check for __proto__ support.
function a() {}
if ( (new a).__proto__ === a.prototype ){
alert('supported');
}else{
@baamenabar
baamenabar / n-of-m-columns.scss
Created March 12, 2015 19:07
Column percentage calculator SASS mixin
/**
* MIXIN n-of-m-columns
* calculates the adequate percentage width and gutter percentage
* @param $n: number of columns to calculate
* @param $m number of total columns in the row
**/
$gridGutter: 24px;
$defaultWidth: 984px;
@mixin n-of-m-columns($n:1, $m:3){
@baamenabar
baamenabar / clearfix-snippet.css
Created March 12, 2015 13:51
Simple clearfix for > IE8
.clearfix:after {
content:"";
display:table;
clear:both;
}
/*
From:
http://cssmojo.com/latest_new_clearfix_so_far/
*/
@baamenabar
baamenabar / importer.php
Created October 1, 2014 19:29
Download and deflate a ZIP file from a remote address.
<?php
$url = 'http://g.m0.cl/sistema/ci_assaabloy.zip';
$path = 'importado.zip';
$fp = fopen($path, 'w');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $fp);
$data = curl_exec($ch);