Skip to content

Instantly share code, notes, and snippets.

View perrygovier's full-sized avatar
👨‍🏫

Perry Govier perrygovier

👨‍🏫
View GitHub Profile
@perrygovier
perrygovier / gist:5774705
Created June 13, 2013 15:37
Handy tool for Cordova editors so alert messages are pretty if on a mobile device but still work in a browser
isMobile = false;
document.addEventListener("deviceready", function(){isMobile = true}, false);
notify = function(msg){
if(isMobile){
navigator.notification.alert(
msg, // message
null, // callback
'Alert', // title
'Ok' // buttonName
);
@perrygovier
perrygovier / directive
Created July 15, 2013 19:23
directive to avoid console errors when evaluating attribute expressions in an ng-include such as src={{myval}}
directive('setattr', function() {
return function(scope, elem, attr){
$(elem).attr(attr.setattr,attr.setattrval);
}
});
var stopit = false;
var tab1 = document.querySelectorAll('.ion-home');
var tab2 = document.querySelectorAll('.ion-heart');
var tab3 = document.querySelectorAll('.ion-gear-b');
function clicky(){
if(stopit)return;
tab2[0].click();
setTimeout(function(){
tab3[0].click();
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Thingdom</title>
<!-- ionic css -->
<!--<link href="lib/css/ionic.css" rel="stylesheet"> -->
<!-- app css -->
<link href="css/app.css" rel="stylesheet">
angular.module('myApp.services', [])
.factory('MyService', function() {
var myVar = true;
return {
getMyVar: function() {
return myVar;
}
setMyVar: function(val){
myVar = val;
This file has been truncated, but you can view the full file.
/*!
* ionic.bundle.js is a concatenation of:
* ionic.js, angular.js, angular-animate.js,
* angular-ui-router.js, and ionic-angular.js
*/
/*!
* Copyright 2014 Drifty Co.
* http://drifty.com/
*
.directive('ionRadio', function() {
return {
restrict: 'E',
replace: true,
require: '?ngModel',
scope: {
ngModel: '=?',
ngValue: '=?',
ngChange: '&',
icon: '@',
[
{
"title": "Firefox Developer Tools - Editable box model, Sublime Text keys",
"id": 7711105,
"url": "https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/",
"points": 115,
"submitted_by": "rnyman",
"submitted_on": "2 hours ago "
},
{
angular.module('todoApp', [])...
.controller....
.filter('searchFilter', function() {
return function(input, searchText) {
if(typeof searchText === 'undefined' || searchText == '')return input;
var output = [];
for(var i=0;i<input.length;i++){
if(input[i].text.indexOf(searchText) > -1){
output.push(input[i]);
@perrygovier
perrygovier / gist:b99d202f2dcb246e2f29
Last active August 29, 2015 14:09
Ionic Codepen Test
#!/bin/bash
# Ionic Directory
IONICLIB="$HOME/Development/ionic/dist/"
arrayTest[0]="test" || (echo "Failure: arrays not supported in this version of bash." && exit 2)
codepen=(