Skip to content

Instantly share code, notes, and snippets.

View B3nCr's full-sized avatar

Ben Crinion B3nCr

  • Sorted
  • United Kingdom
View GitHub Profile
iyr:2011 byr:1924 eyr:2024
hcl:#b6652a ecl:brn
pid:794477411 hgt:162in
using System;
using FluentValidation;
using Xunit;
namespace Tests
{
public class UnitTest1
{
[Theory]
[InlineData("ben",11)]
@B3nCr
B3nCr / get-watchers.js
Created March 4, 2017 09:43 — forked from kentcdodds/get-watchers.js
Get Watchers of element and its children
function getWatchers(root) {
root = angular.element(root || document.documentElement);
var watcherCount = 0;
function getElemWatchers(element) {
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope);
var scopeWatchers = getWatchersFromScope(element.data().$scope);
var watchers = scopeWatchers.concat(isolateWatchers);
angular.forEach(element.children(), function (childElement) {
watchers = watchers.concat(getElemWatchers(angular.element(childElement)));
This file has been truncated, but you can view the full file.
{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "GM_LAYER": "Flood Zone 2", "GM_TYPE": "Unknown Area Type", "LAYER": "Flood Zone 2", "TYPE": "Fluvial \/ Tidal Events" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -3.13100291099694, 54.103820492019217 ], [ -3.131183030923027, 54.103818798616864 ], [ -3.131470641198562, 54.103849799235689 ], [ -3.131761924909434, 54.104004440146241 ], [ -3.131691290715003, 54.104218750491889 ], [ -3.131215149792169, 54.104301963667986 ], [ -3.130939768525513, 54.104304552622381 ], [ -3.130930251938917, 54.103954917134082 ], [ -3.130853647240138, 54.103955637206099 ], [ -3.130852424441365, 54.10391070849851 ], [ -3.131005327565154, 54.103909271185699 ], [ -3.13100291099694, 54.103820492019217 ] ] ] } },
{ "type": "Feature", "properties": { "GM_LAYER": "Flood Zone 2", "GM_TYPE": "Unknown Area Type", "LAYER": "Flood Zone 2", "TYPE": "Fluvial \/ Tidal E
Ian Poulter (11), England
Darren Clarke (3), Northern Ireland
Rory McIlroy (2, 3, 4, 11, 15, 16), Northern Ireland
Justin Rose (2, 11, 14, 15, 16), England
Paul Casey (11, 16), England
Russell Knox (15), Scotland
Shane Lowry (15), Ireland
Graeme McDowell (15), Northern Ireland
Matthew Fitzpatrick (17), England
Andy Sullivan (17), England
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
module MyModule {
'use strict';
export class MaterialNameDirective {
public link: (scope: any /* IProjectsScope*/, element: any/*ng.IAugmentedJQuery*/, attrs: any /*ng.IAttributes*/) => void;
public template = '<div>{{name}}</div>';
constructor(private materialService: Material.MaterialService) {
// It's important to add `link` to the prototype or you will end up with state issues.
// See http://blog.aaronholmes.net/writing-angularjs-directives-as-typescript-classes/#comment-2111298002 for more information.
@B3nCr
B3nCr / gist:bbbe48a951e2cd366911
Last active August 29, 2015 14:13 — forked from anonymous/gist:97efc4f2f12ba51c5cf3
Angular directive which prevents form submit if it's not valid and sets Bootstrap classes
app.directive('validSubmit', ['$parse', function ($parse) {
return {
// we need a form controller to be on the same element as this directive
// in other words: this directive can only be used on a &lt;form&gt;
require: 'form',
// one time action per form
link: function (scope, element, iAttrs, form) {
form.$submitted = false;
// get a hold of the function that handles submission when form is valid
var fn = $parse(iAttrs.validSubmit);