Skip to content

Instantly share code, notes, and snippets.

View fab1an's full-sized avatar

Fabian Zeindl fab1an

View GitHub Profile
class ReactBase extends React.Component {
/* event emitting function, for completeness' sake */
emit(eventName, eventData = {}) {
this.props.dispatch(eventName, eventData);
}
shouldComponentUpdate(nextProps) {
return !_.isEqual(this.props, nextProps);
}
class App extends React.Component {
render() {
const $ = this.props
return (
<div>
<Box {...$.box1} />
<Box {...$.box2} />
</div>
);
import { View, Animated, TouchableHighlight, Text } from 'react-native';
import React, { PropTypes as pt } from "react";
import * as components from "./components";
class MyNavigator extends React.Component {
static propTypes = {
currentScene: pt.object.isRequired
}
state = {
package finalizertest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
import android.support.test.runner.AndroidJUnit4;
@fab1an
fab1an / SetMatcherEditor.java
Created August 30, 2016 11:40
Generic SetMatcherEditor for GlazedLists
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Set;
import java.util.function.Function;
import com.google.common.collect.ImmutableSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @fileoverview Disallow undeclared variables in JSX
* @author Yannick Croissant
*/
'use strict';
/**
* Checks if a node name match the JSX tag convention.
* @param {String} name - Name of the node to check.
## works
create schema core;
create table core.items (
id serial primary key
);
create table core.other (
@fab1an
fab1an / ListEventCompressor.kt
Created January 4, 2017 20:47
ListEventCompressor
import ca.odell.glazedlists.event.ListEvent
import java.util.*
data class ChangeRange(val firstIndex: Int, var count: Int, val type: ChangeType) {
// ~ Delegated --------------------------------------------------------------------------------
val lastIndex: Int
get() = firstIndex + count - 1
@Test
public void bugInGrouper() {
final TransactionList<String> source = new TransactionList<String>(new BasicEventList<String>());
final UniqueList<String> uniqueList = new UniqueList<String>(source, String.CASE_INSENSITIVE_ORDER);
source.add("A");
source.add("A");
source.add("B");
source.beginEvent();
# target server
upstream postgrest {
server localhost:4000;
keepalive 64;
}
# proxy
server {
listen 3000;