Skip to content

Instantly share code, notes, and snippets.

Alvaro alvarouribe

Block or report user

Report or block alvarouribe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alvarouribe
alvarouribe / email_attachment.php
Created Oct 3, 2012 — forked from michaelaguiar/email_attachment.php
PHP: Another Send Email Attachment
View email_attachment.php
<?php
function emailAttachment($to, $fromName, $fromEmail, $subject, $message, $files) {
$headers = "From: $fromName<$fromEmail>";
// boundary
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
// headers for attachment
$headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
@alvarouribe
alvarouribe / lib_validation.js
Created Oct 4, 2012
Javascript: Validation
View lib_validation.js
//if the ext is invalid, display an alert and return false.
//if is valid returns true.
function ValidateExtImg(inputObj) {
var _validFileExtensions = [".jpg", ".jpeg", ".bmp", ".gif", ".png", ".pdf"];
var oInput = inputObj;
if (oInput.type == "file") {
var sFileName = oInput.value;
if (sFileName.length > 0) {
var blnValid = false;
for (var j = 0; j < _validFileExtensions.length; j++) {
View wkhtmltopdf.tablesplit.js
/**
* WkHtmlToPdf table splitting hack.
*
* Script to automatically split multiple-pages-spanning HTML tables for PDF
* generation using webkit.
*
* To use, you must adjust pdfPage object's contents to reflect your PDF's
* page format.
* The tables you want to be automatically splitted when the page ends must
* have a class name of "splitForPrint" (can be changed).
@alvarouribe
alvarouribe / gist:4627820
Last active May 30, 2018
Accesos Directos Sublime Text 2 - Espanol
View gist:4627820

Sublime Text 2 – Accesos Directos (PC y Linux)

“Toda la documentacion aca” :http://www.sublimetext.com/docs/2/.

Edicion

Ctrl+C (si no hay seleccion) Copia toda la linea
Ctrl+X (si no hay seleccion) Corta toda la linea
Ctrl+⇧+K Elimina la linea
Ctrl+↩ Inserta salto de linea en linea anterior
View computed-example.html
<!DOCTYPE html>
<html>
<head>
<title>polymer</title>
<script src="https://rawgit.com/webcomponents/webcomponentsjs/master/webcomponents-lite.js"></script>
<link rel="import" href="https://rawgit.com/Polymer/polymer/master/polymer.html">
</head>
<body>
<dom-module id="my-element">
View polymer-action-and-hidden.html
<!DOCTYPE html>
<html>
<head>
<title>polymer</title>
<script src="https://rawgit.com/webcomponents/webcomponentsjs/master/webcomponents-lite.js"></script>
<link rel="import" href="https://rawgit.com/Polymer/polymer/master/polymer.html">
</head>
<body>
<dom-module id="my-element">
You can’t perform that action at this time.