Skip to content

Instantly share code, notes, and snippets.

View stephenfeather's full-sized avatar

Stephen Feather stephenfeather

View GitHub Profile
@dbankier
dbankier / gist:c0e15ff0babaa878112f
Created May 8, 2014 13:27
Add copyright/license note to the top of all js files
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' {}
@DaveHudson
DaveHudson / Grunt-Installr
Created July 11, 2014 06:32
Grunt.js + Installr API
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
installr_settings: {
releaseNotes: grunt.file.read("./CHANGELOG.txt")
},
titanium: {
build_ios: { // build for ios first
function compile(TypeScript, logger, sourcefilename){
var _this = this;
var ByteOrderMark = {};
ByteOrderMark[ByteOrderMark["None"] = 0] = "None";
ByteOrderMark[ByteOrderMark["Utf8"] = 1] = "Utf8";
ByteOrderMark[ByteOrderMark["Utf16BigEndian"] = 2] = "Utf16BigEndian";
ByteOrderMark[ByteOrderMark["Utf16LittleEndian"] = 3] = "Utf16LittleEndian";
var FileInformation = (function () {
@pec1985
pec1985 / app.js
Created February 28, 2012 03:55
Titanium Vertical Label
// use this as a normal Ti.UI.Label
function VerticalLabel(_params){
// store the text in this variable
var text = _params.text || '';
// create an array of letters
var array = text.split('');
// get the length of the array (letters)
var len = array.length;
/**
* @preserve
* Titanium Cloud Module
*
* This module is used across three distinct platforms (iOS, Android, and Mobile Web), each with their own architectural
* demands upon it.
*
* Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc.
* and licensed under the Apache Public License (version 2)
*/
@pec1985
pec1985 / app.js
Created May 20, 2012 06:55
DashboardView JS module
var Dashboard = require('dashboard');
var win = Ti.UI.createWindow({
backgroundColor:'lightgray'
});
var view = new Dashboard.View();
var data = [];
for(var i = 0; i < 20; i++){
@pec1985
pec1985 / test1.js
Created June 25, 2012 15:37
Optimizing Appcelerator's Titanium
/**
* Test #1
* Adding 10,000 Ti.UI.TableViewRows to a Ti.UI.TableView
* The rows have the Ti.UI.iPhone.TableViewCellSelectionStyle.BLUE constant in them
*
* Total time in my Mac: 1228ms
*/
var win = Ti.UI.createWindow({
backgroundColor: '#ccc'
@pec1985
pec1985 / app.js
Last active October 12, 2015 21:48
Login utility to save to file for titanium
/**
* To be used this way
*/
var Log = require('log');
Log.Info('This is an info log');
Log.Error('This is an error log');
Log.Debug('This is a debug log');
@oroce
oroce / _for iOS users
Created November 2, 2011 18:20
Appcelerator share to native facebook, twitter
This gist is only for Android.
If you would like launch native apps
on iPhone, iPad, you can find information about it in Appcelerator Docs:
-https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.canOpenURL-method.html
-https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.openURL-method.html
More info about iOS URL Schemes: http://handleopenurl.com/
// ==UserScript==
// @name Ingress Player Locations
// @description Shows player locations on the Ingress Intel Map
// @version 1.2
// @match http://www.ingress.com/intel
// @run-at document-start
// ==/UserScript==
function override() {