Skip to content

Instantly share code, notes, and snippets.

View index.php
<!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>
@steve228uk
steve228uk / validator.js
Created Apr 23, 2013
JS Validate script
View validator.js
'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',
View gist:5a8401f766f2673f9bff
.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
}
};
View gist:25e909f4b2208371846b
git config branch.YOURBRANCHHERE.mergeoptions "--no-ff"
View gist:9c42bc206a26614b4c91
filter('clean', function(){
return function(input){
return input.replace(/&/g, 'and').replace(/[^a-zA-Z0-9 -]+/g, '').replace(/\s+/g, '-').toLowerCase();
};
})
View SRCopyableLabel.swift
//
// SRCopyableLabel.swift
//
// Created by Stephen Radford on 08/09/2015.
// Copyright (c) 2015 Cocoon Development Ltd. All rights reserved.
//
import UIKit
class SRCopyableLabel: UILabel {
@steve228uk
steve228uk / example.html
Last active Sep 25, 2021
Deeplink Youtube
View example.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
window.onload = function() {
View gist:1fc2a1fe475e3f3a7ee9
providesPresentationContextTransitionStyle = true
definesPresentationContext = true
modalVc.modalPresentationStyle = .OverCurrentContext
presentViewController(modalVc, animated: true, completion: nil)
View gist:5a8dc8bb00e99688c0ec
(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;
}])