Skip to content

Instantly share code, notes, and snippets.

.factory('ourFactory', function($http, $q){
return {
update: function(){
var defer = $q.defer(); // we're gonna create a new promise to return
$http.get('http://google.com').success(function(data){
d.resolve(data); // This is what we can access from our promise later
});
return d.promise; // return the promise
}
};
git config branch.YOURBRANCHHERE.mergeoptions "--no-ff"
filter('clean', function(){
return function(input){
return input.replace(/&/g, 'and').replace(/[^a-zA-Z0-9 -]+/g, '').replace(/\s+/g, '-').toLowerCase();
};
})
Hello World
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="abstract" content="Personal and professional portfolio of Kevin Steinhardt">
<meta name="author" content="Kevin Steinhardt">
<meta name="copyright" content="Creative Commons Attribution 3.0">
<link rel="stylesheet" type="text/css" href="style.css">
<title>Kevin Steinhardt</title>
</head>
(function(angular) {
'use strict';
angular.module('store', ['ngRoute'])
.controller('MainController', ['$scope','$route','$routeParams','$location', function($scope, $route, $routeParams, $location) {
$scope.$route = $route;
$scope.$location = $location;
$scope.$routeParams = $routeParams;
}])
<label ng-repeat="material in materials" class="materials col-lg-8 col-lg-offset-2 debug" style="border-right: 1px solid black;">
<div class="inner">
<input type="checkbox" ng-model="materials" ng-click="select(item)" checklist-model="choices.materials" checklist-value="material">
<i class="icon-{{material | lowercase}}" ng-class="{class: materials}"></i> {{material | capitalize}}
</div>
</label>
@steve228uk
steve228uk / validator.js
Created April 23, 2013 23:03
JS Validate script
'use strict';
var sr = {};
sr.Validator = function(){
this.errors = [];
this.messages = {
required: 'The :input: is required',
email: 'The :input: is not a valid email address',
{"jolts": [{"Date": "1/6/2016", "Question": "Today I'm working on...", "Response": "Today I'm working on "}, {"Date": "1/6/2016", "Question": "Who's your favorite writer?", "Response": "My favorite writer is "}, {"Date": "1/6/2016", "Question": "What are you saving up for?", "Response": "I'm saving up for "}, {"Date": "1/7/2016", "Question": "Name a few of your favorite things.", "Response": "These are a few of my favorite things:"}, {"Date": "1/7/2016", "Question": "A screenshot of a text exchange. ", "Response": "A recent text exchange:"}, {"Date": "1/7/2016", "Question": "What's the best class you've ever taken?", "Response": "The best class I've ever taken was"}, {"Date": "1/8/2016", "Question": "What talent do you wish you had?", "Response": "I've always wanted to be talented at"}, {"Date": "1/8/2016", "Question": "What's the weirdest thing you've ever eaten?", "Response": "The weirdest thing I've eaten is "}, {"Date": "1/8/2016", "Question": "Paste whatever's in your clipboard right now.", "Response": "
@steve228uk
steve228uk / GIFPlayer.h
Created January 28, 2016 23:16
GIFPlayer for OSX by the guys at Byte Inc.
//
// GIFPlayer.h
// Byte
//
// Created by Dom Hofmann on 8/9/15.
// Copyright © 2015 Byte, Inc. All rights reserved.
//
#import "ByteObject.h"
#import <Cocoa/Cocoa.h>