THIS REPO IS INCOMPLETE
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
.filter('tel', function () { | |
return function (tel) { | |
if (!tel) { return ''; } | |
var value = tel.toString().trim().replace(/^\+/, ''); | |
if (value.match(/[^0-9]/)) { | |
return tel; | |
} |
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
document.addEventListener('deviceready', function () { | |
if (navigator.notification) { // Override default HTML alert with native dialog | |
window.alert = function (message) { | |
navigator.notification.alert( | |
message, // message | |
null, // callback | |
"Notification Title", // title | |
'OK' // buttonName | |
); | |
}; |
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
/** | |
* Returns a bare object of the URL's query parameters. | |
* You can pass just a query string rather than a complete URL. | |
* The default URL is the current page. | |
*/ | |
function getUrlParams (url) { | |
// http://stackoverflow.com/a/23946023/2407309 | |
if (typeof url == 'undefined') { | |
url = window.location.search | |
} |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Single-Column Responsive Email Template</title> | |
<style> | |
@media only screen and (min-device-width: 541px) { | |
.content { |
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 | |
// requires php5 | |
define('UPLOAD_DIR', 'images/'); | |
$img = $_POST['img']; | |
$img = str_replace('data:image/png;base64,', '', $img); | |
$img = str_replace(' ', '+', $img); | |
$data = base64_decode($img); | |
$file = UPLOAD_DIR . uniqid() . '.png'; | |
$success = file_put_contents($file, $data); | |
print $success ? $file : 'Unable to save the file.'; |
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
require 'fileutils' | |
# An OS X System Service for quickly filing image files to a Jekyll blog folder, | |
# putting Markdown links to the files on the clipboard. | |
# Copyright Brett Terpstra 2013 | |
# Config | |
# ====== | |
# Where to store the images | |
base_path = '~/Sites/dev/octopress/source/uploads/' |
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
// REQUIRES: | |
// moment.js - https://github.com/moment/momentjs.com | |
// USAGE: | |
// {{ someDate | moment: [any moment function] : [param1] : [param2] : [param n] | |
// EXAMPLES: | |
// {{ someDate | moment: 'format': 'MMM DD, YYYY' }} | |
// {{ someDate | moment: 'fromNow' }} |
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
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
var Storage = function (type) { | |
function createCookie(name, value, days) { | |
var date, expires; | |
if (days) { | |
date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
expires = "; expires="+date.toGMTString(); |