Skip to content

Instantly share code, notes, and snippets.

View sjmueller's full-sized avatar

Sam Mueller sjmueller

View GitHub Profile
@sjmueller
sjmueller / Es6KeyboardAvoidingView.js
Created November 15, 2017 06:39
Es6 version of the KeyboardAvoidingView React Native component (stripped of every behavior except padding)
import React, { Component } from 'react';
import { Keyboard, LayoutAnimation, Platform, View } from 'react-native';
/**
* An es6 version of RN KeyboardAvoidingView, with support for iPhone X safe area
*/
class KeyboardSyncView extends Component {
constructor() {
super();
this.state = {
@sjmueller
sjmueller / http.js
Created October 24, 2015 19:34
http util using fetch
// add fetch import here.
const baseUrl = `http://localhost:8888/api/`;
class ResponseError extends Error {
constructor(messages) {
super();
this.messages = messages;
}
}
@sjmueller
sjmueller / BarcodeScanner.swift
Created June 22, 2015 01:10
Example of a custom react-native component, written in swift. Original author @euforic
// Barcode.swift
import UIKit;
import AVFoundation;
@objc(BarcodeScanner)
public class BarcodeScanner: UIView, AVCaptureMetadataOutputObjectsDelegate {
let session : AVCaptureSession = AVCaptureSession()
var previewLayer : AVCaptureVideoPreviewLayer!