Skip to content

Instantly share code, notes, and snippets.

View pillowsoft's full-sized avatar

Brad Pillow pillowsoft

View GitHub Profile
//
// See Slidedeck for more information
//
// http://www.slideshare.net/aaronksaunders/parse-appcelerator-titanium-the-easy-way-jan2013
//
// Aaron K Saunders
// Clearly Innovative Inc
//
// twitter : @aaronksaunders
// blog : blog.clearlyinnovative.com
@aaronksaunders
aaronksaunders / acs_model_spec.js
Created February 8, 2013 23:16
sample test spec for testing async calls in alloy application using behave.js
//Setup module to run Behave tests
require('behave').andSetup(this);
describe('The model helper package: login USER', function() {
var ACSModels = new (require('models').MODELS)(Alloy);
it.eventually('*** logs in user', function(done) {
var model = ACSModels.createModel('user', {
@rblalock
rblalock / handleItemSwipe.js
Last active November 18, 2017 19:16
TableViewRow swipe sample
/**
* Handle Item Swipe
* @param {Object} _event
*/
$.handleItemSwipe = function(_event) {
var row = _event.source;
var id = row.id;
var controls = Alloy.createController("rowControls");
row.add(controls.wrapper);
@icholy
icholy / json-pointer-slice.md
Last active December 14, 2015 07:28
Json Pointer Slices

The json-pointer draft is missing a very important piece: slices.

Example Data:

var obj = {
  foo: [
    { bar: 1 },
    { bar: 2 },
 { bar: 3 }
@grantges
grantges / WildText.js
Last active December 14, 2015 11:18
CommonJS Module for Titanium that allows you to create gradient filled Labels (note: iOS only) Updated to include updates from Todd Lindner - as noted here : https://gist.github.com/toddlindner/5093536
/*
WildText CommonJS module for Appcelerator Titanium
Create dynamic gradient filled text in your iOS Applications using this simple module.
@params : text - String. The text for your label
font - Font. Specify the font attributes for the label (defaults to standard size, weight and family),
backgroundGradient - BackgroundGradient. Specify your backgroundGradient object (defaults to White to Black linear gradient),
Top - Integer. Top property for your label,
Left - Integer. Left Property for your Label,
@masudcsesust04
masudcsesust04 / angular-pagination.html
Created March 4, 2013 09:52
Pagination with AngularJS for Typekit API
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Pagination with AngularJS - jsFiddle demo</title>
<script type='text/javascript' src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js'></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular-sanitize.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular-resource.js"></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
@kanemathers
kanemathers / gist:5158245
Created March 14, 2013 02:08
AngularJS Rickshaw directive
.directive('graph', [
function()
{
/* Wrap the ajax graph and strip out the ajax shit. It's Angulars
* job to handle that.
*/
var AngularRickshaw = Rickshaw.Class.create(Rickshaw.Graph.Ajax, {
initialize: function($super, args)
{
this.request = function() {};
@praeclarum
praeclarum / Layout.cs
Created March 16, 2013 05:23
A C# syntax for NSLayoutConstraints.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using MonoTouch.UIKit;
namespace Async.iOS
{
public static class Layout
{
@puffnfresh
puffnfresh / Example.hx
Last active March 6, 2020 01:09
Macro to generate "value classes" in Haxe
import precog.macro.ValueClass;
class ABC implements ValueClass {
var a: Int;
var b: Bool;
var c: String;
}
/*
class ABC extends ValueClass {
@ricardoalcocer
ricardoalcocer / index.js
Last active December 15, 2015 23:19
Android Holo Actionbar Alloy Sample Based on ideas by https://github.com/hoyo/ActionBarSample/tree/master/app
function doClickMenu(evt){
alert(evt.source.title);
}
// we need to do some things to the Window once it is properly instanciated, so we add an event listener to its OPEN event
$.win.addEventListener('open',function(){
var actionBar = $.win.activity.actionBar; // get a handle to the action bar
actionBar.title='My App'; // change the App Title
actionBar.displayHomeAsUp=true; // Show the "angle" pointing back
actionBar.onHomeIconItemSelected = function() { // what to do when the "home" icon is pressed