Skip to content

Instantly share code, notes, and snippets.

🛫

Max Lynch mlynch

🛫
Block or report user

Report or block mlynch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mlynch
mlynch / service.js
Last active Aug 29, 2015
Reusable cordova plugin wrapping service service
View service.js
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 Apr 18, 2014
Starter directive
View directive.js
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 Apr 26, 2014
Ionic Nav Routing API Proposal
View app.js
angular.module('myApp', ['ionic'])
.config(function($ionicNavProvider)) {
$ionicNavProvider.url('/contact/:contactId', {
templateUrl: 'contact.html',
controller: 'ContactCtrl',
extra: {}
})
})
@mlynch
mlynch / nav.js
Last active Aug 29, 2015
first idea for nav transition stuff
View nav.js
/**
* 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 Aug 18, 2014
post for mdata
View test.js
$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("&");
View ace-editor.js
angular.module('maxlynch')
/**
* A simple ace-editor widget for adding a rich code editor
* in place of a textarea with full ngModel support.
*
* Usage:
*
* <ace-editor language="javascript" theme="monokai"></ace-editor>
*
@mlynch
mlynch / drawer.js
Last active Aug 29, 2015
Menu and Drawer toggle
View drawer.js
angular.module('myApp', ['ionic'])
.directive('menuAndDrawerClose', ['$ionicViewService', function($ionicViewService) {
return {
restrict: 'AC',
require: '?^ionSideMenus,?^drawer',
link: function($scope, $element, $attr, ctrls) {
$element.bind('click', function(){
ctrls[0] && ctrls[0].close();
ctrls[1] && ctrls[1].close();
View gist:5a53aa2f6a997c386e02
$ npm install -g gulp
/
> v8flags@1.0.3 install C:\Users\Max_2\AppData\Roaming\npm\node_modules\gulp\nod
e_modules\v8flags
> node fetch.js
-
C:\Users\Max_2\AppData\Roaming\npm\node_modules\gulp\node_modules\v8flags\fetch.
@mlynch
mlynch / landing2conv.js
Created Oct 14, 2011
MongoDB landing page conversion
View landing2conv.js
/*
A MongoDB query script. Example output:
760 landings
69 signups
Conversion rate: 9.078947368421053%
Campaign conversions:
organic: 8.042% - 53/659
betabuild1: 0% - 0/6
betanocodingbuilder: 37.500% - 6/16
betaonlydrag: 50.000% - 2/4
@mlynch
mlynch / app1.html
Created Dec 28, 2011
jQM Tutorial - HTML Page
View app1.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
<title>My App</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js">
</script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js">
You can’t perform that action at this time.