Skip to content

Instantly share code, notes, and snippets.

View evturn's full-sized avatar
🔒
Loading status...

Evan Turner evturn

🔒
Loading status...
View GitHub Profile
@evturn
evturn / react-native-pin.js
Created August 26, 2017 06:01
Simple component for managing an arbitrary amount of digits as input for a pin.
import React, { Component } from 'react';
import { StyleSheet, TextInput, View } from 'react-native';
/*
*
* class SomeComponent extends Component {
* onValueChange = pin => {
* return someOperation(pin);
* }
*
@evturn
evturn / keybase.md
Created April 21, 2017 19:52
keybase.io verification

Keybase proof

I hereby claim:

  • I am evturn on github.
  • I am evturn (https://keybase.io/evturn) on keybase.
  • I have a public key whose fingerprint is D1BD F3A8 825E E25E B72E 0ACB F612 A187 2CA6 6236

To claim this, I am signing this object:

@evturn
evturn / colorblind-explosion.xml
Last active July 6, 2016 17:39
Sublime color scheme that may or may not look horrendous
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai Phoenix</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@evturn
evturn / slash-commands.js
Last active June 29, 2016 16:30
Observables & Slack's slash commands
const React, { Component } from 'react'
const { render } from 'react-dom'
const { Observable } from 'rxjs'
const db = {}
class Backpack extends Component {
constructor(props) {
super(props)
@evturn
evturn / react-inward.js
Last active June 21, 2016 07:10
Inward React Nesting
const { cloneElement } = React
const plopProps = plops => (
props => (
inward => (
plops(props)
? cloneElement(plops(props), props, (plops(props).props.children || []).concat(inward.plops(props)))
: inward.plops(props)
)
)
@evturn
evturn / immutable-maps.js
Last active June 12, 2016 01:25
Create Collections of Immutable Maps
class RecordMap {
set(map, record) {
if (map && !record) {
record = map
map = Immutable.Map()
}
return map.set(record.id, new Record(record))
}
setGroup(map, data) {
@evturn
evturn / observable-from-scratch
Last active January 2, 2017 03:05
Creating an Observable from scratch
function Observer(destination) {
this.destination = destination
}
Observer.prototype = {
constructor: Observer,
next(value) {
if (this.destination.next && !this.isUnsubscribed) {
this.destination.next && this.destination.next(value)
@evturn
evturn / RxJs-Observables.md
Last active April 2, 2016 19:47
Reactive Programming Basics

RxJS

Creating Observables

The create operator in the Rx.Observable object takes a callback that accepts an Observer as a parameter. That function defines how the Observable will emit values

var observable = Rx.Observable.create(function(observer) { 
	observer.onNext('Sergio');
   observer.onNext('Tyrone');
@evturn
evturn / redux-async
Created February 6, 2016 09:01
Redux flow & asynchronicity
// Sup.
@evturn
evturn / push-to-remote-server.md
Last active August 29, 2015 14:26
Push to Remote Droplet

Pushing repo to droplet

Droplet console

From root:

$ git clone git@github:USER/REPO.git --bare

Local console