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 / 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__":
// 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 / 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">
@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 / 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 / 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 / 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 / nav.js
Last active August 29, 2015 14:01
first idea for nav transition stuff
/**
* For each navigation controller on scope, we can have one child control animation during transitions
* by enabling overriding a function:
*/
controller('MyCtrl', function($scope, $ionicNavDelegate, $ionicAnimation)) {
var pushAnim = $ionicAnimation({
duration: 1,
curve: 'ease-in-out',
@mlynch
mlynch / test.js
Created August 18, 2014 19:07
post for mdata
$http({
method: 'POST',
url: apiUrl + '/signup',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
data: data,
transformRequest: function(obj) {
var str = [];
for( var p in obj )
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
return str.join("&");
@mlynch
mlynch / Undo.md
Last active January 8, 2025 00:58
Undo/Redo

Undo/Redo

Undo/Redo is one of those features of an application that you almost always need to have if you are building serious GUI tools for people to do work.

The best way to look at undo/redo is two stacks of operations the user has performed:

  • The Undo stack is the "history" of what they've done
  • The redo stack is the breadcrumbs back to the initial state before they started undoing