Skip to content

Instantly share code, notes, and snippets.

View calendee's full-sized avatar

Calendee LLC calendee

View GitHub Profile
@calendee
calendee / testChainedPromise.js
Last active January 7, 2016 18:34
A simple example of chained promises using Q promise library.
var Q = require("q");
var slowFunction1 = function( myObject ) {
console.log("\nRunning slowFunction1");
console.log(myObject);
var deferred = Q.defer();
setTimeout( function() {
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/
*
* Ionic, v0.9.17
* A powerful HTML5 mobile app framework.
* http://ionicframework.com/
*
* By @maxlynch, @helloimben, @adamdbradley <3
*
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/
*
* Ionic, v0.9.17
* A powerful HTML5 mobile app framework.
* http://ionicframework.com/
*
* By @maxlynch, @helloimben, @adamdbradley <3
*
@calendee
calendee / app.scss
Last active December 6, 2018 14:16 — forked from malixsys/app.scss
form i.icon.error {
color: $assertive;
}
form input + i.icon.error {
display: none;
margin-left: 8px;
}
form.ng-submitted input.ng-invalid + i.icon.error {
@calendee
calendee / gulpfile.js
Created November 6, 2014 12:33
Ionic Build Process
var gulp = require('gulp');
var minifyCss = require('gulp-minify-css');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var gulpIgnore = require('gulp-ignore');
var rimraf = require('rimraf');
var gutil = require('gulp-util');
var bower = require('bower');
@calendee
calendee / badges.js
Created November 6, 2014 22:30
PushWoosh Badge Process
// Outside of angular, need to listen for `push-notification` event.
document.addEventListener('push-notification', function(event) {
// Get access to angular to report event.
var body = document.getElementsByTagName("body")[0];
var appController = angular.element(body).scope();
appController.processPushnotification(event);
});
@calendee
calendee / index.html
Created November 8, 2014 12:56
Girls Scouts Training
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Girl Scout Class</title>
<link rel="stylesheet" href="reset.css"/>
<link rel="stylesheet" href="style.css"/>
</head>
@calendee
calendee / rules.json
Last active August 29, 2015 14:10
Firebase : Unique Mobiles with Security Restrictions
{
"rules": {
".read": false,
".write": false,
"users" : {
"$userId" : {
".write" : "$userId === auth.uid && !data.exists() && newData.exists() && auth.uid !== 'anonymous'",
// Can only read if the node is the same as the uid
@calendee
calendee / scope-getting.js
Last active February 15, 2017 17:16
Fire Angular RootScope Event from Console, Get Get An AngularJS service
// Right click an element and select "Inspect Element"
// Courtesy : http://michalostruszka.pl/blog/2013/09/24/angularjs-in-browsers-console/ &
// http://ionicframework.com/blog/angularjs-console/
var scope = angular.element($0).scope();
var rootScope = scope.$root
scope.$apply( function() {
rootScope.$broadcast('showOffline', {msg : 'goes here', duration : 1230});
})
@calendee
calendee / imageUploadService.js
Last active May 4, 2021 22:03
Cloudinary / Ionic Image Upload Service
```
(function() {
/**
* @ngInject
*/
function ius($q, $ionicLoading, $cordovaFile, $translate, CLOUDINARY_CONFIGS) {
var service = {};