Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
yeah, that

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

:octocat:
yeah, that
View GitHub Profile
@baamenabar
baamenabar / PagoWebPay.php
Created Aug 7, 2012
Clase de pago de webpay
View PagoWebPay.php
<?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.
@baamenabar
baamenabar / curl_get_or_save_functions.php
Created Sep 10, 2012
PHP cURL get or save simple stuff
View curl_get_or_save_functions.php
<?php
/****************************************************************************
PHP CURL functions for getting data or asytnchronously saving it to file.
It is header redirect tolerant. like the 302 http status.
Save data to file with cURL: save_data_to_file_w_curl($url,$pathToFile);
Get data with cURL get_data_w_curl($url);
/**
* MIT License
@baamenabar
baamenabar / index.php
Last active May 3, 2020
PHP List images in folder
View index.php
<?php
/*
list all the files with extension nn on a folder
the first parameter of glob is a regex to match files.
you can do:
path_to_dir/*.html
to select all the .html files in the path_to_dir folder
*NOTE:* the regex on glob is case sensitive
@baamenabar
baamenabar / getElementByClass.js
Created Nov 6, 2012
Dustin Diaz's get element by class JS function
View getElementByClass.js
/*
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 / FLVPlayback loop
Created Jun 8, 2013
How to do a loop or looping video using the FLVplayback with AS3
View FLVPlayback loop
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 / index.html
Created Jul 5, 2013
A CodePen by Agustín Amenabar. Simple accesible tooltip class - For an anchor with a span inside, behaves well with tabbed navigation.
View index.html
<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 / index.html
Last active Dec 19, 2015
Simple accesible tooltip class - An anchor with a span inside, behaves well with tab navigation and screen readers. A CodePen by Agustín Amenabar.
View index.html
<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 / avisa webmaster
Last active Dec 20, 2015
Little funtion for letting the webmaste know there's been something wrong on the server.
View avisa webmaster
<?php
$nombreMarca = 'Client Brand';
$mailAministrador = 'me@client.com';
$mailWebmaster = 'now@iminabar.com';
//the above are usually already on the script.
function avisaWebmaster($message=''){
$message.="\r\n\r\nen la fecha:".date('Y-n-d H:i:s');
$message.="\r\n\r\nen el archivo:".$_SERVER['PHP_SELF']."\r\nllamdo en:".$_SERVER['REQUEST_URI'];
$message.="\r\n\r\ncon la info:".@print_r( $_SERVER, true );
global $mailWebmaster;
@baamenabar
baamenabar / loop para espiral
Created Sep 2, 2013
para calcular el largo de una espiral
View loop para espiral
var largo = 16.014;
var total = 16.014;
var ancho = 0.03;
var vueltas = 0;
for (largo=largo; largo>0; largo-=(ancho*6.28)){
total+=largo;
console.log('total: ',total);
vueltas++;
}
console.log('total general: ',total);
View Contract Killer 3.md

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.