Skip to content

Instantly share code, notes, and snippets.

View zackify's full-sized avatar
🤠
coding like crazy

Zach Silveira zackify

🤠
coding like crazy
View GitHub Profile
class PassthroughFader extends React.Component{
constructor(){
super()
this.state = {
opacity: 0,
}
this.delays = []
this.running = false
}
@zackify
zackify / fader.jsx
Last active September 21, 2015 21:11
class Fader extends React.Component{
constructor(){
super()
this.state = {
opacity: 0,
}
this.delays = []
this.running = false
}
@zackify
zackify / .eslintrc
Last active December 21, 2015 17:57
Upgrade to Babel 6
{
"parser": "babel-eslint",
"env": {
"es6": true,
"mocha": true,
"node": true
},
"ecmaFeatures": {
"blockBindings": true,
"forOf": true,
@zackify
zackify / requireTouchID.jsx
Created November 11, 2015 16:10
example of requiring touchID after 10 minutes and app opens
'use strict'
import React from 'react-native'
import ExNavigator from '@exponent/react-native-navigator'
import TimerMixin from 'react-timer-mixin'
import TouchID from 'react-native-touch-id'
import Login from './components/login'
var {
AsyncStorage,
@zackify
zackify / react.jsx
Created November 20, 2015 20:58
example react
class Test extends React.Component{
render(){
let { size } = this.props
//then you don't need to add this.props every time, looks cleaner.
return (
<div>
{size}
</div>
@zackify
zackify / dropdown-with-toggle.jsx
Last active December 22, 2015 15:26
The simplest react dropdown component ever
import React from 'react'
export default class Dropdown extends React.Component{
constructor(props){
super()
this.state = { show: props.show }
this.onClick = this.onClick.bind(this)
}
onClick(){
@zackify
zackify / README.md
Created January 12, 2016 23:39
everything you need for dynamic routing and server rendering with react-router

setup some routes, make a few components, then run server.js through babel:

"use strict"
require('babel-register')
require('./server.js')

run webpack and it will chunk your files out for you if your routes look like:

import React from 'react-native';
var Dimensions = require('Dimensions');
var windowSize = Dimensions.get('window');
import SafariView from 'react-native-safari-view'
var {
StyleSheet,
Text,
View,
TextInput,
@zackify
zackify / transition.jsx
Last active January 31, 2016 23:46
transition in react router demo
import React from 'react'
export default class Transition extends React.Component{
static contextTypes = {
router: React.PropTypes.object
};
constructor(props){
super()
let opacity = 1
@zackify
zackify / binder.jsx
Created February 5, 2016 02:16
Auto-binds actions to your redux store. Idk if this has been done or not haha
import { connect } from 'react-redux'
export const binder = component => {
return class Binder extends React.Component {
static contextTypes = {
store: React.PropTypes.object
};
render() {
let boundActions = {}
for(let action in component.actions) {