Navigation Menu

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 / 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("&");
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 August 29, 2015 14:08
Menu and Drawer toggle
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();
@mlynch
mlynch / gist:5a53aa2f6a997c386e02
Created November 18, 2014 05:55
v8flags issue
$ 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 October 14, 2011 17:14
MongoDB landing page conversion
/*
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 December 28, 2011 18:40
jQM Tutorial - HTML Page
<!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">