View gist:c64bb716cf407a1a28c9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Source: http://www.apphp.com/index.php?snippet=php-get-remote-ip-address */ | |
function makeMyUrlFriendly($url){ | |
$output = preg_replace("/\s+/" , "_" , trim($url)); | |
$output = preg_replace("/\W+/" , "" , $output); | |
$output = preg_replace("/_/" , "-" , $output); | |
return strtolower($output); | |
} | |
?> |
View gist:60d0ef940a9b42323e23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
return; | |
} | |
var result = authorisedUrlFetch(email, {}); | |
Browser.msgBox(result.getContentText()); |
View com.mysql.mysql.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First, create a new file: /Library/LaunchDaemons/com.mysql.mysql.plist | |
<?xml version="1.0" encoding="UTF-8"?> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true /> | |
<key>Label</key> | |
<string>com.mysql.mysqld</string> | |
<key>ProgramArguments</key> |
View multiple-markers-google-maps.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
<title>Google Maps Multiple Markers</title> | |
<script src="http://maps.google.com/maps/api/js?sensor=false" | |
type="text/javascript"></script> | |
</head> | |
<body> | |
<div id="map" style="width: 500px; height: 400px;"></div> |
View styles-placeholder.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::-webkit-input-placeholder { | |
color: red; | |
} | |
:-moz-placeholder { /* Firefox 18- */ | |
color: red; | |
} | |
::-moz-placeholder { /* Firefox 19+ */ | |
color: red; |
View replace-special-chars.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; | |
var mc_base_url = 'http://us7.api.mailchimp.com/1.3/?method=listSubscribe'; | |
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){ |
View all-favicons.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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"> |
View changevalueinput.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script type="text/Javascript"> | |
$(document).ready(function () { | |
$(function () { | |
$('.add').on('click',function(){ | |
var $qty=$(this).closest('p').find('.qty'); |
NewerOlder