Skip to content

Instantly share code, notes, and snippets.

Ian Tearle iantearle

Block or report user

Report or block iantearle

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
View install phantomjs 2.1.1 - ubuntu
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
Mauricevb / cloudkit-server.php
Created Feb 7, 2016
CloudKit server-to-server in PHP
View cloudkit-server.php
// Constants
$PRIVATE_PEM_LOCATION = 'eckey.pem'; // Store this file outside the public folder!
// Config
$url = '' . $CONTAINER . '/development/public/records/query';
$body = '{"query":{"recordType":"Articles"}}';
joashp / PushNotifications.php
Last active Sep 20, 2019
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
View PushNotifications.php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
dbankier / gist:c0e15ff0babaa878112f
Created May 8, 2014
Add copyright/license note to the top of all js files
View gist:c0e15ff0babaa878112f
find . -type f | grep -v node_modules | grep -v modules | grep -v .git | grep -v .json | grep .js | xargs -I{} perl -pi -e 'print "/*\n * Copyright (c) 2011-2014 YY Digital Pty Ltd. All Rights Reserved.\n * Please see the LICENSE file included with this distribution for details.\n */\n\n" if $. == 1' {}
Rogichi / app.js
Last active Dec 19, 2015
Tweet Example (Using VIEZEL Codebird for Appcelerator Titanium. Twitter API 1.1 ):
View app.js
// How Publish a Tweet (Titanium)
// Full Codebird API is here:
// Codebird for Appcelerator Titanium. Using the Twitter API 1.1:
viezel / app.js
Last active Aug 13, 2016
Codebird for Appcelerator Titanium. Using the Twitter API 1.1
View app.js
// This is an example of use.
// Here we use the new Bearer Token thats make it possible to get tweets without user login
// More info on Bearer here:
// Full Codebird API is here:
var Codebird = require("codebird");
var cb = new Codebird();
var bearerToken = Ti.App.Properties.getString('TwitterBearerToken', null);
tsteur / alloy.jmk
Last active Nov 8, 2017
Simple build configuration file for Titanium Mobile Alloy to remove unimportant log calls if build type is production
View alloy.jmk
function isProduction(alloyConfig)
return 'production' == alloyConfig.deploytype;
function removeUnimportantLogCallsFromContent(content)
if (!content) {
josheinstein / gist:5586469
Last active Dec 19, 2018
Handle back button issues with Twitter Bootstrap's tab component.
View gist:5586469
// Handle back button issues with Twitter Bootstrap's tab component.
// Based on:
// It has been changed to avoid the following side effects:
// - Switching tabs was being added to navigation history which is undesirable
// (Worked around this by using location.replace instead of setting the hash property)
// - Browser scroll position was lost due to fragment navigation
// (Worked around this by converting #id values to #!id values before navigating.)
$(document).ready(function () {
if (location.hash.substr(0,2) == "#!") {
kwhinnery /
Created May 13, 2013
Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes.

Automatic TiShadow Installs

Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes. Edit your JS files in a text editor, save, then switch to the test device or simulator. Profit.

Install supervisor

[sudo] npm install -g supervisor

Execute tishadow run anytime a JavaScript file changes

You can’t perform that action at this time.