Skip to content

Instantly share code, notes, and snippets.

Avatar

Garry Taylor gpltaylor

View GitHub Profile
View JavaPointers.java
import java.util.ArrayList;
class Person {
private String name;
public Person(String name) {
setName(name);
}
public String getName() {
View NavigationPrompt.js
import React, { PropTypes } from 'react'
const BEFOREUNLOAD = "beforeunload"; // see: http://stackoverflow.com/questions/39094138/reactjs-event-listener-beforeunload-added-but-not-removed
class NavigationPrompt extends React.Component {
static contextTypes = {
router: PropTypes.object.isRequired
}
static defaultProps = {
when: true
View Redux-Connect
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[Todo App]">
<script src="//fb.me/react-0.14.3.js"></script>
<script src="//fb.me/react-dom-0.14.3.js"></script>
<script src="https://wzrd.in/standalone/expect@latest"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.5/redux.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-redux/4.0.6/react-redux.js"></script>
View DebounceLostProps.js
import React from 'react'
import { Debounce } from 'react-throttle'
var XPos = (props) => {
return <div>
x: {props.x}
</div>
}
var YPos = (props) => {
@gpltaylor
gpltaylor / FormidableLabs spectacle
Last active Oct 3, 2016
How to separate Slides into module files
View FormidableLabs spectacle
import React from "react";
import {
Link,
Slide,
Text,
Heading
} from "spectacle";
var MainBody = () => {
return <div>
@gpltaylor
gpltaylor / ShouldSerializeContractResolver.cs
Created Sep 26, 2015
Sample ContractResolver that conditionally removes properties from JSON. This can be plumbed into ASP.NET/API
View ShouldSerializeContractResolver.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Linq
{
using AutoMapper;
using Newtonsoft.Json;
You can’t perform that action at this time.