Skip to content

Instantly share code, notes, and snippets.

View spikebrehm's full-sized avatar

Spike Brehm spikebrehm

View GitHub Profile
@spikebrehm
spikebrehm / App.js
Created April 28, 2017 21:47
React VR blog post: Day 1 posters example
import React, { Component } from 'react';
import {
asset,
Pano,
View,
StyleSheet,
} from 'react-vr';
import Poster from './Poster';
import posters from '../posters.json';
@spikebrehm
spikebrehm / SimpleComponent.jsx
Created April 24, 2017 20:02
Simple example of a React component
class SimpleComponent extends React.Component {
render() {
return (
<View>
<Header title="A simple example" />
<Button onPress={onPressButton}>
Press me
</Button>
</View>
);
[ignore]
# This config is based on the `.flowconfig` file generated by `react-native
# init`.
# We fork some components by platform
.*/*[.]android.js
# Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
@spikebrehm
spikebrehm / ErrorBridge.m
Created August 29, 2016 23:27
React Native error bridge
#import "ErrorBridge.h"
#import <React/RCTRedbox.h>
@implementation ErrorBridge
@synthesize bridge = _bridge;
RCT_EXPORT_MODULE()
- (NSArray<NSString *> *)supportedEvents
@spikebrehm
spikebrehm / Redux-resources.md
Last active September 16, 2018 14:42
Redux resources, courtesy of Dan Abramov.
░░░░▄▄▄▄▀▀▀▀▀▀▀▀▄▄▄▄▄▄
░░░░█░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░▀▀▄
░░░█░░░▒▒▒▒▒▒░░░░░░░░▒▒▒░░█
░░█░░░░░░▄██▀▄▄░░░░░▄▄▄░░░█
░▀▒▄▄▄▒░█▀▀▀▀▄▄█░░░██▄▄█░░░█
█▒█▒▄░▀▄▄▄▀░░░░░░░░█░░░▒▒▒▒▒█
█▒█░█▀▄▄░░░░░█▀░░░░▀▄░░▄▀▀▀▄▒█
░█▀▄░█▄░█▀▄▄░▀░▀▀░▄▄▀░░░░█░░█
░░█░░▀▄▀█▄▄░█▀▀▀▄▄▄▄▀▀█▀██░█
░░░█░░██░░▀█▄▄▄█▄▄█▄████░█
@spikebrehm
spikebrehm / htmlDecode.js
Created August 24, 2014 18:53
Is this method of decoding HTML entities safe from XSS injections?
function htmlDecode(input) {
var e = document.createElement('div');
e.innerHTML = input;
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
}
@spikebrehm
spikebrehm / tmux.out
Created May 21, 2014 17:02
Named #tmux sessions FTW
vagrant@localhost:~$ tmux list-sessions
railsc: 1 windows (created Wed May 21 16:57:04 2014) [283x66] (attached)
rookery: 1 windows (created Wed May 21 16:56:30 2014) [141x32] (attached)
specs: 1 windows (created Wed May 21 16:58:34 2014) [141x15] (attached)
zeus: 1 windows (created Tue May 20 23:42:45 2014) [141x14] (attached)
// console.log(global.Client.toString());
function (host, port) {
this.host = host;
this.port = port;
this.socket = require('dgram').createSocket('udp4');
}
@spikebrehm
spikebrehm / gulpfile.js
Created January 14, 2014 20:00
Why is hbsfy not working? Where the heck does this error come from?
var gulp = require('gulp')
, browserify = require('gulp-browserify')
;
gulp.task('scripts', function() {
return gulp.src('./js/sample.js')
.pipe(browserify({
debug: true,
transform: ['hbsfy'],
}))