Skip to content

Instantly share code, notes, and snippets.


Alberto Hernández devluis

View GitHub Profile
View gist:c64bb716cf407a1a28c9
/* Source: */
function makeMyUrlFriendly($url){
$output = preg_replace("/\s+/" , "_" , trim($url));
$output = preg_replace("/\W+/" , "" , $output);
$output = preg_replace("/_/" , "-" , $output);
return strtolower($output);
View gist:60d0ef940a9b42323e23
function getSignature() {
//pretty basic function for testing
if ( startupChecks()) { return; }
var email = SpreadsheetApp.getActiveSpreadsheet().getActiveCell().getValue().toString();
if ( email === "" ) {
Browser.msgBox("No email selected", "Please select a cell containing a user's email" , Browser.Buttons.OK);
var result = authorisedUrlFetch(email, {});
devluis / com.mysql.mysql.plist
Created Mar 21, 2015
Auto-load MySQL on startup on OSX Yosemite
View com.mysql.mysql.plist
First, create a new file: /Library/LaunchDaemons/com.mysql.mysql.plist
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<true />
View multiple-markers-google-maps.html
<!DOCTYPE html>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps Multiple Markers</title>
<script src=""
<div id="map" style="width: 500px; height: 400px;"></div>
devluis / horizontal-responsive-multilevel-menu.html
Last active May 29, 2020
Responsive Multilevel Horizontal Menu only with CSS
View horizontal-responsive-multilevel-menu.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>Responsive Multilevel Horizontal Menu</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
#menu ul {
margin: 0;
padding: 0;
devluis / styles-placeholder.css
Created Dec 15, 2014
Style Placeholder Text
View styles-placeholder.css
::-webkit-input-placeholder {
color: red;
:-moz-placeholder { /* Firefox 18- */
color: red;
::-moz-placeholder { /* Firefox 19+ */
color: red;
devluis / replace-special-chars.php
Created Dec 12, 2014
Replace special chars in php
View replace-special-chars.php
$stringOriginal = "Este string contiene acentos, ÁFRICA, MÉXICO, ÍNDICE, CANCIÓN y NÚMERO.";
$specialChars = array("á", "é", "í", "ó", "ú", "Á", "É", "Í", "Ó", "Ú", "ñ", "Ñ");
$replacementChars = array("a", "e", "i", "o", "u", "A", "E", "I", "O", "U", "n", "N");
$replacedString = str_replace($specialChars, $replacementChars, $originalString);
print $replacedString; // output 'Este string contiene acentos, ÁFRICA, MÉXICO, ÍNDICE, CANCIÓN y NÚMERO.'
View gist:77208839596faeee71fd
var API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
var mc_base_url = '';
var mc_list_id = 'xxxxxxxxxx';
var mc_double_optin = false;
* Uses the MailChimp API to add a subscriber to a list.
function sendToMailChimp_(fn, ln, em, yr){
devluis / all-favicons.html
Created Nov 1, 2014
Snippet Favicons for all devices
View all-favicons.html
<!-- Favicon for old browsers -->
<link rel="shortcut icon" type="image/x-icon" href="img/favicon/16.ico"/>
<!-- Favicons for browser with out support .ico file -->
<link rel="icon" type="image/png" href="img/favicon/16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="img/favicon/32x32.png" sizes="32x32">
<!-- For Google TV -->
<link rel="icon" type="image/png" href="img/favicon/96x96.png" sizes="96x96">
devluis / changevalueinput.html
Created Oct 18, 2014
Increase / Decrease value on input with Jquery
View changevalueinput.html
<script src="//"></script>
<script type="text/Javascript">
$(document).ready(function () {
$(function () {
var $qty=$(this).closest('p').find('.qty');
You can’t perform that action at this time.