Skip to content

Instantly share code, notes, and snippets.

View brennancheung's full-sized avatar

Brennan Cheung brennancheung

View GitHub Profile
export const Counter = ({ initialValue, onChange }) => {
const [count, setCount] = useState(initialValue)
useEffect(() => onChange(count), [count])
const incrementCounter = () => setCount(count + 1)
return (
<div>
Count: {count}
const mapExample = arr => arr.map(square)
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'L9'
Plugin 'int3/vim-extradite'
Plugin 'scrooloose/syntastic'
/* global Obniz */
import React from 'react'
import tokens from './tokens'
class RemoteDevice extends React.Component {
state = { text: this.props.text || `id: ${this.props.id}` }
componentDidMount () {
const { id } = this.props
const access_token = tokens[id]
#include <ESP8266WiFi.h>
const char* ssid = "ssid";
const char* password = "password";
WiFiServer server(80);
String header;
int gpio_pins [] = { D0, D1, D2 };
import React from 'react'
import DataLoader from 'core/DataLoader'
import CRUDListContainer from 'core/common/CRUDListContainer'
import requiresAuthentication from 'openstack/util/requiresAuthentication'
import ListTable from 'core/common/list_table/ListTable'
import createCRUDActions from 'core/helpers/createCRUDActions'
import { compose } from 'core/fp'
import { withAppContext } from 'core/AppContext'
import { withRouter } from 'react-router-dom'
import { withScopedPreferences } from 'core/PreferencesProvider'
import React from 'react'
import Picklist from 'core/common/Picklist'
import createCRUDComponents from 'core/helpers/createCRUDComponents'
import Loader from 'core/common/Loader'
import { withAppContext } from 'core/AppContext'
import { loadInfrastructure } from '../infrastructure/actions'
import { deleteNamespace } from './actions'
const ListPage = ({ ListContainer }) => {
class ListPage extends React.Component {
import React from 'react'
import PropTypes from 'prop-types'
import { withAppContext } from 'core/AppContext'
import { compose } from 'ramda'
class FSQuery extends React.Component {
state = { data: null }
async componentDidMount () {
const { context, path } = this.props
const GoalsForToday = () => (
<FSQuery path="/users/$userId/goals">
{({ data }) => {
return (
<Section title="Goals for today">
<AddGoal />
<br />
<Paper>
<Table>
<TableHead>
int PUL = 10;
int DIR = 11;
int ENA = 12;
void setup() {
pinMode(PUL, OUTPUT);
pinMode(DIR, OUTPUT);
pinMode(ENA, OUTPUT);
digitalWrite(PUL, LOW);