Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE HTML>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
var num = 0;
function scrollDec() { $('.slide').css({marginTop: '-' + $('.wrap').height()*(Math.abs(num--)%3) + 'px'}) }
function scroll() { $('.slide').css({marginTop: '-' + $('.wrap').height()*(num++%3) + 'px'}) }
setInterval(scroll, 2000);
</script>
# coding: utf-8
# In[67]:
import serial
import time
import random
ser = serial.Serial('/dev/tty.usbserial-A6007ZJB', 19200)
@iainnash
iainnash / keybase.md
Created July 27, 2017 04:45
keybase.md

Keybase proof

I hereby claim:

  • I am iainnash on github.
  • I am iainnash (https://keybase.io/iainnash) on keybase.
  • I have a public key ASC7W_vFQrHfQEUrioHEg1PtjLQfI7lqMumuACAlAPuyRwo

To claim this, I am signing this object:

@iainnash
iainnash / page-layouts.jsx
Created February 23, 2018 16:17
Page Layouts Example
<Page context="mobile">
<Title>Test Page</Title>
<Links current="/help">
<Link to="/main">Home</Link>
<Link to="/help">Help</Link>
</Links>
<Content>
<div>Page</div>
</Content>
<Footer>Oscar Health</Footer>
@iainnash
iainnash / table-config-example.jsx
Created February 23, 2018 16:18
Example Table Config
<Table data={data}>
<Table.ColumnGroup header="Name">
<Table.Column accessor="firstName">First Name</Table.Column>
<Table.Column accessor={d => d.lastName}>Last Name</Table.Column>
</Table.ColumnGroup>
<Table.ColumnGroup header="Info">
<Table.Column accessor="age">Age</Table.Column>
</Table.ColumnGroup>
</Table>
@iainnash
iainnash / table-config-example.jsx
Created February 23, 2018 16:19
Table Config Example
const UserTable = [{
Header: 'Name',
columns: [{
Header: 'First Name',
accessor: 'firstName'
}, {
Header: 'Last Name',
id: 'lastName',
accessor: d => d.lastName
}]
@iainnash
iainnash / first-table-configuration.jsx
Created February 23, 2018 16:48
first-table-configuration.jsx
<TableWrapper>
<TableHeader><ColumnHeader>Name</ColumnHeader><ColumnHeader>Age</ColumnHeader></TableHeader>
<RowContent columnComponents={[RenderName, RenderAge]} data={this.tableData.data} />
<TableFooter>
<Pagination onPageUpdate={this.tableData.onPageUpdate} />
</TableFooter>
</TableWrapper>
// Mocking out the Date.now() function (not used by moment)
const realDateNow = Date.now;
jest.spyOn(Date, 'now').mockImplementation(() => new Date('2019-01-01'));
// Test code here
Date.now.mockRestore();
// Mocking out Date constructor object (used by moment)
const nowString = '2018-02-02T20:20:20';
// Mock out the date object to return a mock null constructor
const MockDate = (lastDate) => (...args) =>
import ShallowRenderer from 'react-test-renderer/shallow';
import {TodayIntro} from './TodayIntro';
describe('TodayIntro', () => {
it('should render a hello message with a date', () => {
MockDate.set('2018-01-01');
const renderer = new ShallowRenderer();
renderer.render(<TodayIntro name="test" />);
const result = renderer.getRenderOutput();
PFont f;
void setup() {
f = createFont("Arial", 42, true);
cnt = 0;
fullScreen();
}
String[] words = {