Skip to content

Instantly share code, notes, and snippets.

View jacobtoye's full-sized avatar

Jacob Toye jacobtoye

  • Hamilton, New Zealand
View GitHub Profile
import * as React from 'react';
import './styles.css';
export interface AnimationProps {
isAnimated?: boolean;
}
export const withAnimation = <T extends {}>(WrappedComponent: React.ComponentClass<T>) => {
return class extends React.Component<T & AnimationProps> {
import * as React from 'react';
import './styles.css';
export interface ButtonProps {
text: string;
disabled?: boolean;
onClick?: (event: any) => void;
}
public static class OverspeedPeriodExtensions
{
public static IQueryable<OverspeedPeriod> WithRemoteId(this IQueryable<OverspeedPeriod> overspeedPeriods, params int[] remoteIds)
{
return overspeedPeriods.Where(l => remoteIds.Contains(l.RemoteId));
}
/// <summary>
/// Filters by all periods that start within date range.
///
// Assumes LEGEND exists like in legend.js and that map is an already initialized Leaflet map
for(var i = 0; i < LEGEND.sections.length; i++) {
for(var j = 0; j < LEGEND.sections[i].keys.length; j++) {
L.marker([LEGEND.sections[i].keys[j].coordinates[0], LEGEND.sections[i].keys[j].coordinates[1]])
.bindLabel(LEGEND.sections[i].keys[j].text, { noHide: true })
.addTo(map)
.showLabel();
}
}
@jacobtoye
jacobtoye / gist:6454046
Created September 5, 2013 18:21
Adding Leaflet.label to a Leaflet map using GeoJSON as the data source
var data = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "two"
},
"geometry": {
"type": "Point",
@jacobtoye
jacobtoye / gist:6445824
Created September 5, 2013 03:42
Leaflet + Leaflet.label + GeoJSON
var data = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "two"
},
"geometry": {
"type": "Point",
@jacobtoye
jacobtoye / gist:4748297
Created February 10, 2013 03:58
MultilineEntryElement for Monotouch.Dialog
using System;
using CrossUI.Touch.Dialog.Elements;
using System.Drawing;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using CrossUI.Touch.Dialog;
/// <summary>
/// Multiline entry element.
/// </summary>
@jacobtoye
jacobtoye / app.build.js
Created May 25, 2012 00:09
Directory Structure
({
appDir: '../',
baseUrl: '../js/',
dir: '../../Website-build',
//optimize: 'none',
paths: {
({
baseUrl: "../js",
mainConfigFile: "../js/main.js",
optimize: "none",
name: "main",
//excludeShallow: ["jquery", "handlebars", "leaflet", "wax"],
out: "../js/main-built.js",
paths: {
jquery: 'empty:',
body {
background: #383c45;
color: #e6e6e6; }
a {
color: #949494; }
a:link, a:visited {
color: #949494; }
a:hover, a:active, a:focus {
color: #c7c7c7; }