Skip to content

Instantly share code, notes, and snippets.

Tim Wisniewski timwis

Block or report user

Report or block timwis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.js
const html = require('bel')
window.CustomButton = function (props) {
console.log('Called CustomButton', props)
return html`
<button style="background-color: ${props.color}">
${props.label}
</button>
`
}
@timwis
timwis / api.apib
Created Jun 12, 2017
Dataface API spec
View api.apib
FORMAT: 1A
# Dataface
Build and manage data with a spreadsheet-like interface.
# Group Sheets
Resources related to sheets (which is what dataface calls database tables).
@timwis
timwis / get-schema.sql
Last active May 4, 2017
Get postgres table schema including keys/constraints
View get-schema.sql
SELECT
cols.column_name,
cols.data_type,
cols.character_maximum_length,
cols.column_default,
cols.is_nullable::boolean,
constr.constraint_type,
pg_catalog.col_description(cls.oid, cols.ordinal_position::int)::jsonb
FROM
pg_catalog.pg_class cls,
@timwis
timwis / grid.js
Last active Apr 23, 2017
Combining HyperList with Nanocomponent
View grid.js
const html = require('choo/html')
const css = require('sheetify')
const HyperListComponent = require('./hyperlist-component')
const prefix = css`
thead, tbody {
display: block;
}
`
@timwis
timwis / docker-compose.yml
Last active Apr 12, 2017
PostgREST via docker-compose
View docker-compose.yml
version: '2'
services:
db:
image: postgres
volumes:
- ./scripts/contacts.sql:/docker-entrypoint-initdb.d/contacts.sql
ports:
- "5432:5432"
restart: always
environment:
View onload-multiple.js
const html = require('choo/html')
const component = require('nanocomponent')
const menu = require('../components/menu')
module.exports = function home (state, emit) {
return component({
render: (state, emit) => {
return html`
<body>
View layout.js
import React from 'react'
import 'foundation-sites/dist/css/foundation.css'
import TopBar from './TopBar'
class Layout extends React.Component {
render () {
<div className='container'>
<TopBar />
{this.props.children}
View bel-example.js
const html = require('bel')
['Hello', 'world'].map((text) => {
return html`<p><span>${text}</span></p>`
})
@timwis
timwis / README.md
Last active Dec 29, 2016
Indent multi-line string
View README.md

Indent multi-line string

`
<div>
  ${indent(JSON.stringify(data, null, 2), 2)}
</div>
`
@timwis
timwis / list.py
Created Dec 28, 2016
Get a list of OpenDataPhilly datasets that have resources hosted on Socrata
View list.py
import csv
import sys
import requests
odp_packages_url = 'https://opendataphilly.org/api/3/action/package_search?rows=10000'
odp_dataset_prefix = 'https://opendataphilly.org/package/'
socrata_keyword = '//data.phila.gov'
response = requests.get(odp_packages_url)
You can’t perform that action at this time.