Skip to content

Instantly share code, notes, and snippets.

Jamie Spittal Spittal

Block or report user

Report or block Spittal

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
@Spittal
Spittal / Format Time Angular Filter
Created Jul 31, 2014
Angular Time Filter that takes milliseconds and returns it as full minutes and seconds. For example: 60000 = 1:00, 6000000 = 100:00, 6000000 = 1:40:00 (withHour = true)
View Format Time Angular Filter
.filter('formatTime', function() {
return function(milliseconds,withHour) {
var seconds = parseInt((milliseconds/1000)%60);
var minutes = parseInt((milliseconds/(1000*60))%60);
var hours = parseInt((milliseconds/(1000*60*60))%24);
var out = "";
minutes = (parseInt(minutes) + (60 * parseInt(hours)));
minutes = (minutes < 10) ? "0" + minutes : minutes;
seconds = (seconds < 10) ? "0" + seconds : seconds;
@Spittal
Spittal / disabled-if-directive.js
Last active Aug 29, 2015
Disabled If Expression Directive for AngularJS
View disabled-if-directive.js
.directive('disabledIf', disabledIf);
function disabledIf() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
var expr = attrs.disabledIf;
scope.$watch(expr, function(val) {
if (val) {
@Spittal
Spittal / Skyrocket Notes App Technical.md
Last active Dec 30, 2018
Skyrocket Notes App Technical Overview
View Skyrocket Notes App Technical.md

Skyrocket Notes

Create a simple 'Note Taking' application on the web using the technologies of your choosing.

We want you to feel like you can be creative and comfortable during this task. So, take the time you need to develop this. Share it with us either on Github as public repo or as a .zip archive. Remember that you can use whatever tools you would like to complete this task, just make sure you leave us instructions on how to run the application.

View filepload.ts
public updateAvatar(file: File): Observable<any> {
return Observable.create((observer) => {
let formData: FormData = new FormData(),
xhr: XMLHttpRequest = new XMLHttpRequest();
formData.append('avatar', file, file.name);
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
View borm_builder.ts
import { Injectable } from 'angular2/core';
import {
FormBuilder,
Validators,
Control,
ControlGroup }
from 'angular2/common';
import { ValidationHelper } from
'./validation-helper';
View formbuilder.ts
import { Injectable } from '@angular/core';
import {
Validators,
Control,
ControlGroup
} from '@angular/common';
import { ValidationHelper } from
'../../../../common/helpers/validation.helper';
@Spittal
Spittal / obersavbles.ts
Created Aug 24, 2016
Why Observables are amazing
View obersavbles.ts
import { Injectable } from '@angular/core';
import { Observable, ReplaySubject, Subscription } from 'rxjs';
import { SlideAnimator } from './slide-animator';
import { SlideObservables } from './slide-observables';
import { SlideHelper } from './slide-helper';
import {
SlideServiceConfig,
SlideEventEnd,
SlideEventStart,
SlideEvent,
View Ts to JS.ts
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { FormGroup, FormControl } from '@angular/forms';
import { Observable } from 'rxjs';
import { FlashService } from '../../core';
import { AdminService } from '../admin.service';
export class AdminUserIndexComponent implements OnInit {
@Spittal
Spittal / docker-compose.yaml
Created Sep 15, 2018
Docker compose file from SBVR
View docker-compose.yaml
version: '3'
services:
fpm:
image: sbvr/laravel-fpm:2.1.2
volumes:
- app:/var/www
networks:
- appnet
worker:
@Spittal
Spittal / docker-compose.override.yaml
Created Sep 15, 2018
Docker Compose override from Springboard VR
View docker-compose.override.yaml
version: '3'
services:
fpm:
volumes:
- ./:/var/www
environment:
- OPCACHE_ENABLED=0
worker:
volumes:
You can’t perform that action at this time.