Skip to content

Instantly share code, notes, and snippets.

View gregavola's full-sized avatar

Greg Avola gregavola

View GitHub Profile
@gregavola
gregavola / dynamicSharing.js
Created January 15, 2021 18:07
A way to dynamic share content via Screensnaps IO: http://screensnaps.io/use-cases/dynamic-share-content
const axois = require('axois')
// Payload to send, make sure you include any CSS or Font Library at the time
const data = {
html: "ENTER YOUR MARKUP HERE",
}
const config = {
headers: {
Authorization: 'USER_ID_HERE',
@gregavola
gregavola / checkPrivateModeiOS.js
Last active February 20, 2016 19:28
How to check Private/Public Mode on Safari Mobile or SafariViewController
try {
storage.setItem(storageTestKey, 'test');
storage.removeItem(storageTestKey);
} catch (e) {
if (e.code === DOMException.QUOTA_EXCEEDED_ERR && storage.length === 0) {
// private mode
} else {
// public mode
}
}
@gregavola
gregavola / facebookError
Created November 11, 2015 12:29
FacebookErrorPage
<!DOCTYPE html>
<html lang="en" id="facebook">
<head>
<title>Facebook | Error</title>
<meta charset="utf-8">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="cache-control" content="no-store">
<meta http-equiv="cache-control" content="max-age=0">
<meta http-equiv="expires" content="-1">
<meta http-equiv="pragma" content="no-cache">
@gregavola
gregavola / callback.php
Created July 10, 2014 00:34
tumblrphp-quick-start
<?php
session_start();
require ("tumblrPHP.php");
$consumer = "XXXXXXX";
$secret = "XXXXXXXX";
$tumblr = new Tumblr($consumer, $secret, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
package com.phonegap.plugins.mapkit;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.LOG;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@gregavola
gregavola / fastclick.js
Created August 30, 2013 14:07
fastclick - mods
/**
* FastClick: Set up handling of fast clicks
*
* On touch WebKit (eg Android, iPhone) onclick events are usually
* delayed by ~300ms to ensure that they are clicks rather than other
* interactions such as double-tap to zoom.
*
* To work around this, add a document listener which converts touches
* to clicks on a global basis, excluding scrolls and gestures. The
* default click events are then cancelled to prevent double-clicks.
@gregavola
gregavola / abctime.js
Last active December 21, 2015 19:49
TimeAgo - Customized
var abcTime = function(ele, format, refresh) {
/* main */
var now = moment();
$(ele).each(function() {
if ($(this).attr("data-abctime")) {
var time = moment($(this).attr("data-abctime"));
}
else {
@gregavola
gregavola / FastclickExample
Created August 13, 2013 14:58
How to use FastClick
function onLayerClick() {
// do your class switching here
}
var fasterClick = function() {
var fasterClickButton = document.querySelector('.button');
new FastClick(fastClickButton);
}
@gregavola
gregavola / gist:6221999
Created August 13, 2013 14:54
FastClick for Tablet Webs
/**
* FastClick: Set up handling of fast clicks
*
* On touch WebKit (eg Android, iPhone) onclick events are usually
* delayed by ~300ms to ensure that they are clicks rather than other
* interactions such as double-tap to zoom.
*
* To work around this, add a document listener which converts touches
* to clicks on a global basis, excluding scrolls and gestures. The
* default click events are then cancelled to prevent double-clicks.
<?php
// include the Tumblr PHP file. The directory is up to your choosing.
include ("lib/tumblrPHP.php");
// Enter your Consumer / Secret Key:
$consumer = "CONSUMER_KEY";
$secret = "SECRET_KEY";
// Start the Session
session_start();