Skip to content

Instantly share code, notes, and snippets.

Avatar

Spike Brehm spikebrehm

View GitHub Profile
@spikebrehm
spikebrehm / App.js
Created Apr 28, 2017
React VR blog post: Day 1 posters example
View App.js
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 Apr 24, 2017
Simple example of a React component
View SimpleComponent.jsx
class SimpleComponent extends React.Component {
render() {
return (
<View>
<Header title="A simple example" />
<Button onPress={onPressButton}>
Press me
</Button>
</View>
);
View .flowconfig
[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 Aug 29, 2016
React Native error bridge
View ErrorBridge.m
#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 Sep 16, 2018
Redux resources, courtesy of Dan Abramov.
View Redux-resources.md
View :trollface:
░░░░▄▄▄▄▀▀▀▀▀▀▀▀▄▄▄▄▄▄
░░░░█░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░▀▀▄
░░░█░░░▒▒▒▒▒▒░░░░░░░░▒▒▒░░█
░░█░░░░░░▄██▀▄▄░░░░░▄▄▄░░░█
░▀▒▄▄▄▒░█▀▀▀▀▄▄█░░░██▄▄█░░░█
█▒█▒▄░▀▄▄▄▀░░░░░░░░█░░░▒▒▒▒▒█
█▒█░█▀▄▄░░░░░█▀░░░░▀▄░░▄▀▀▀▄▒█
░█▀▄░█▄░█▀▄▄░▀░▀▀░▄▄▀░░░░█░░█
░░█░░▀▄▀█▄▄░█▀▀▀▄▄▄▄▀▀█▀██░█
░░░█░░██░░▀█▄▄▄█▄▄█▄████░█
@spikebrehm
spikebrehm / htmlDecode.js
Created Aug 24, 2014
Is this method of decoding HTML entities safe from XSS injections?
View htmlDecode.js
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
Named #tmux sessions FTW
View tmux.out
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)
View global-client.js
// 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 Jan 14, 2014
Why is hbsfy not working? Where the heck does this error come from?
View gulpfile.js
var gulp = require('gulp')
, browserify = require('gulp-browserify')
;
gulp.task('scripts', function() {
return gulp.src('./js/sample.js')
.pipe(browserify({
debug: true,
transform: ['hbsfy'],
}))