Skip to content

Instantly share code, notes, and snippets.

View freidamachoi's full-sized avatar

Bo freidamachoi

View GitHub Profile
/**
* This little helper is called instead of on() to monitor data and handle auth expiration
* It assumes that you monitor authentication state and re-auth if
* your auth token expires. It also doesn't help with any transactions, set ops, or
* other writes which could be in progress when authentication is lost--those will
* explode in glorious flashes of failure
*
* To support IE8, you will want these polyfills:
* forEach: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Polyfill
* indexOf: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf#Polyfill
@freidamachoi
freidamachoi / ngapp.html
Created April 23, 2014 23:56 — forked from andreapavoni/ngapp.html
Flickr AngularJs
<!--
This code is a working example of the code shown in the 12devs[0]'s article:
"Rapid Prototyping with AngularJS"[1] by Tom Ashworth[2].
I put it here for reference ;-)
[0] http://12devs.co.uk
[1] http://12devs.co.uk/articles/rapid-prototyping-with-angularjs/
[2] http://twitter.com/phuunet
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module('myApp', ['ngCookies']).factory('BaseObject', [
'$log', '$http', function($log, $http) {
var BaseObject;
return BaseObject = (function() {
function BaseObject(options) {
this.options = options;
@freidamachoi
freidamachoi / app.js
Created June 3, 2014 19:45 — forked from katowulf/app.js
Kato's queue service --- we use this.
var Firebase = require('firebase');
var Request = require('./request.js');
var Reply = require('./reply.js');
var Tasks = require('./tasks');
var Queue = require('./queue.js');
var fb = new Firebase(process.env.FIREBASE_URL).child('queue');
fb.auth(process.env.FIREBASE_TOKEN, function(err) {
if(err) { throw err; }
else {
angular.module('app')
.controller('ImageUpload', ['$scope', '$log',
function ImageUpload($scope, $log) {
$scope.upload_image = function (image) {
if (!image.valid) return;
var imagesRef, safename, imageUpload;
image.isUploading = true;
imageUpload = {
(function () {
var COMPILED = !0,
goog = goog || {};
goog.global = this;
goog.DEBUG = !0;
goog.LOCALE = "en";
goog.provide = function (a) {
if (!COMPILED) {
if (goog.isProvided_(a)) throw Error('Namespace "' + a + '" already declared.');
delete goog.implicitNamespaces_[a];
'use strict';
angular.module('reusableThings')
.directive('fileDropzone', () ->
restrict: 'A'
scope: {
file: '='
fileName: '='
}
link: (scope, element, attrs) ->
@freidamachoi
freidamachoi / README.md
Last active August 29, 2015 14:06 — forked from hilios/README.md

$pageTitle

Allows to control the page title from the AngularJS route system, controllers or any other component through an injectable service.

ngPageTitle - Page title service (run tests)

To get started add the module to your app and configure the page title provider:

// vim: ft=javascript:
/*jslint sloppy: true, vars: true, white: true, nomen: true, browser: true */
/*global SpreadsheetApp, UiApp, UrlFetchApp, Utilities */
/*
* A script to automate requesting data from an external url that outputs CSV data.
*
* Adapted from the Google Analytics Report Automation (magic) script.
* @author [email protected] (Nick Mihailovski)
* @author [email protected] (Ian Lewis)
*/
<?php
/**
* Require All Columns of List Field
* http://gravitywiz.com/require-all-columns-of-list-field/
*/
class GWRequireListColumns {
private $field_ids;
public static $fields_with_req_cols = array();