Skip to content

Instantly share code, notes, and snippets.

View wedgybo's full-sized avatar

Jamie Sutherland wedgybo

View GitHub Profile
@wedgybo
wedgybo / Fastlane.rb
Last active April 13, 2016 16:30
Fastlane configuration
default_platform :ios
platform :ios do
before_all do
# ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
# cocoapods
# increment_build_number
@wedgybo
wedgybo / stateConfig.js
Created March 3, 2015 22:39
Configuring view hierarchy into your state config
$stateProvider.state('tab.feeds', {
url: 'feeds',
views: {
'tab-feeds': {
templateUrl: 'features/feeds/feeds.html',
controller: 'FeedsCtrl'
}
}
}.state('tab.feeds/feed', {
url: 'feeds/:feed',
@wedgybo
wedgybo / OpenUrlService.js
Last active January 7, 2016 20:23
AngularJS service to listen for app opens via a custom URL
angular.module('mlz.openurl', [])
.factory('OpenUrlService', ['$log', '$location', '$rootScope', '$ionicHistory', function ($log, $location, $rootScope, $ionicHistory) {
var openUrl = function (url) {
$log.debug('Handling open URL ' + url);
// Stop it from caching the first view as one to return when the app opens
$ionicHistory.nextViewOptions({
historyRoot: true,
@wedgybo
wedgybo / app.js
Last active December 24, 2015 01:24
if ('cordova' in window) {
// Create a sticky event for handling the app being opened via a custom URL
cordova.addStickyDocumentEventHandler('handleopenurl');
}
function handleOpenURL (url) {
cordova.fireDocumentEvent('handleopenurl', { url: url });
};
@wedgybo
wedgybo / backButtonDirective.js
Created March 3, 2015 22:17
Ionic back button directive
var BackButtonCtrl = function ($scope, $log, $state, $ionicHistory, $ionicViewSwitcher) {
var ctrl = this;
/**
* Checks to see if there is a view to navigate back to
* if we have no current back view.
*
* @param {string} state The current view state
* @return {boolean} If there is a view we should navigate back to
@wedgybo
wedgybo / gist:3978c5fc7fb74b43ef24
Created November 7, 2014 16:17
Network interceptor
app.factory('NetworkActivityInterceptor', ['$q', '$injector', function ($q, $injector) {
var NetworkActivity;
return {
request: function (config) {
NetworkActivity = $injector.get('NetworkActivity');
if (NetworkActivity.enabled) {
var $cordovaNetwork = $injector.get('$cordovaNetwork');
@wedgybo
wedgybo / gist:8801261
Created February 4, 2014 10:30
AngularJS UITableView example
<div mlz-ui-table-view="items" mlz-ui-table-view-row-height="100" mlz-ui-table-view-buffer="20">
<div class="mlz-ui-table-view-wrapper">
<div ng-repeat="item in tableView.buffer.items track by item.$$position">
<dt ng-bind="item.name"></dt>
<dd ng-bind="item.details"></dd>
</div>
</div>
</div>
@wedgybo
wedgybo / gist:2484221
Created April 24, 2012 22:07
My tree overrides
Ext.define('HOD.overrides.TreeDnD', {}, function() {
Ext.override(Ext.tree.ViewDropZone, {
onContainerOver : function(dd, e, data) {
var defaultCls = this.dropNotAllowed;
if (this.allowContainerDrops)
defaultCls = this.dropAllowed;
return e.getTarget('.' + this.indicatorCls) ? this.currentCls : defaultCls;
},
@wedgybo
wedgybo / gist:2484199
Created April 24, 2012 22:03
treeview event
// In my controller control config
'organisation positions treeview': {
beforedrop: this.updatePositions,
drop: this.saveHierarchy
},
// The update positions function.
updatePositions: function(node, source, model, pos, dropFn, options) {
@wedgybo
wedgybo / breadcrumb-icon.css
Created April 18, 2012 22:10
Missing CSS for ExtJS4 Breadcrumbs
.icon-arrow {
background: url(../../images/arrow.png) no-repeat center center !important;
padding-right: 12px;
margin-left: -4px;
height: 33px !important;
}