Skip to content

Instantly share code, notes, and snippets.

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>
@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',
.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();
};
})
@steve228uk
steve228uk / SRCopyableLabel.swift
Last active February 26, 2022 21:08
Copyable UILabel
//
// 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 February 4, 2024 13:14
Deeplink Youtube
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
window.onload = function() {
@steve228uk
steve228uk / gist:1fc2a1fe475e3f3a7ee9
Created October 16, 2015 11:14
Transparent tvOS modal
providesPresentationContextTransitionStyle = true
definesPresentationContext = true
modalVc.modalPresentationStyle = .OverCurrentContext
presentViewController(modalVc, animated: true, completion: nil)
(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;
}])