Skip to content

Instantly share code, notes, and snippets.

View mlynch's full-sized avatar
🍂
Building something new

Max Lynch mlynch

🍂
Building something new
View GitHub Profile
@mlynch
mlynch / app.js
Created April 26, 2014 17:49
Ionic Nav Routing API Proposal
angular.module('myApp', ['ionic'])
.config(function($ionicNavProvider)) {
$ionicNavProvider.url('/contact/:contactId', {
templateUrl: 'contact.html',
controller: 'ContactCtrl',
extra: {}
})
})
@mlynch
mlynch / directive.js
Created April 18, 2014 21:02
Starter directive
angular.module('myApp.directives', [])
.directive('myCanvas', function() {
return {
// Angular needs to know what type of usage we want to allow for this (attribute, class name, or tag).
// For this example, a tag is great.
restrict: 'E',
// We want to replace the original custom tag with a template
replace: true,
@mlynch
mlynch / service.js
Last active August 29, 2015 14:00
Reusable cordova plugin wrapping service service
angular.module('myApp.services', [])
.factory('Camera', ['$q', function($q) {
return {
getPicture: function() {
var q = $q.defer();
navigator.camera.getPicture(function(imageURI) {
// Do any magic you need
@mlynch
mlynch / ionicNavState.js
Created December 18, 2013 22:50
Ionic Nav State Thingy
directive('tab', ['NavStateDelegate', '$scope', function(NavStateDelegate, $scope) {
return {
//
link: function($scope, $element, $attr) {
// Indicate to this delegate we want to control a nav bar
NavStateDelegate.enable(scope);
}
}
}])
@mlynch
mlynch / codiqa.html
Created August 6, 2013 00:17
Codiqa Responsive Features
<div class="container">
<h2>Also included in every plan</h2>
<div class="row">
<div class="col-6 col-lg-3">
<h4>Team Collaboration</h4>
</div>
<div class="col-6 col-lg-3">
<h4>Live Preview</h4>
</div>
<div class="col-6 col-lg-3">
// Use client to interact with Force.com platform
client.create("Account", { "Name" : "blerg3" },
function(response) {
console.log(response);
alert("Object successfully created.");
},
function(errorXhr) {
if (errorXhr.status == 401) {
// Invalid access token
@mlynch
mlynch / helloworld.py
Created June 27, 2013 03:03
Hello world
import web
urls = ("/.*", "hello")
app = web.application(urls, globals())
class hello:
def GET(self):
return 'Hello, world!'
if __name__ == "__main__":
@mlynch
mlynch / feedthefire.js
Created April 30, 2013 16:51
FeedTheFire Codiqa Demo
var ref = new Firebase("https://YOUR_FIREBASE_NAME.firebaseio.com/");
ref.child("meta").once("value", function(snapshot) {
$("#feed > :first").html(snapshot.val().description);
});
ref.child("articles").limit(10).on("child_added", function(snapshot) {
var article = snapshot.val();
var link = $("<a>", {"href": article.link, "target": "_blank"});
$("#feed").append($("<li>").append(link.html(article.title)));
$('#feed').listview('refresh');
});
---
layout: default
title: Welcome
---
<div class="page-header">
<h1>Jetstrap Docs</h1>
</div>
Welcome!
$(document).on "click", "a[href^='/']", (event) ->
href = $(event.currentTarget).attr('href')
# Check if the link matches our route
passThrough = href.indexOf('/dash') != 0
# Allow shift+click for new tabs, etc.
if !passThrough && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey
event.preventDefault()