This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const Counter = ({ initialValue, onChange }) => { | |
const [count, setCount] = useState(initialValue) | |
useEffect(() => onChange(count), [count]) | |
const incrementCounter = () => setCount(count + 1) | |
return ( | |
<div> | |
Count: {count} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mapExample = arr => arr.map(square) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
const char* ssid = "ssid"; | |
const char* password = "password"; | |
WiFiServer server(80); | |
String header; | |
int gpio_pins [] = { D0, D1, D2 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const GoalsForToday = () => ( | |
<FSQuery path="/users/$userId/goals"> | |
{({ data }) => { | |
return ( | |
<Section title="Goals for today"> | |
<AddGoal /> | |
<br /> | |
<Paper> | |
<Table> | |
<TableHead> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int PUL = 10; | |
int DIR = 11; | |
int ENA = 12; | |
void setup() { | |
pinMode(PUL, OUTPUT); | |
pinMode(DIR, OUTPUT); | |
pinMode(ENA, OUTPUT); | |
digitalWrite(PUL, LOW); |