Skip to content

Instantly share code, notes, and snippets.

@chrisbay
chrisbay / index.html
Created May 23, 2019 16:34
Forms Studio Starter Code
<!doctype html>
<head>
<meta charset="utf-8">
<script>
// TODO: create a handler
window.addEventListener('load', function(){
// TODO: register the handler
});
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Largest Cities In the US</title>
<script type="text/javascript" src="cities.json"></script>
<script>
function getData() {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chrisbay
chrisbay / print_bot_id.py
Created June 25, 2018 16:06
Get a Slackbot's ID
from slackclient import SlackClient
BOT_NAME = # provide your bot's name/handle, without the @
slack_client = SlackClient(os.getenv('SLACK_BOT_TOKEN'))
api_call = slack_client.api_call("users.list")
if api_call.get('ok'):
users = api_call.get('members')
for row in reader:
for user in users:
@chrisbay
chrisbay / load_data_geo.sh
Last active January 7, 2019 13:33
Load some data into a local Elasticsearch instance, with geo_point fields!
curl -XPOST 'localhost:9200/twitter/tweets' -H 'Content-type:application/json' -d '
{
"date" : "2014-09-13",
"name" : "Mary Jones",
"tweet" : "Rational databases are so yesterday",
"user_id" : 2,
"likes": 1,
"location": "37.910076, -122.065186"
}
'
@chrisbay
chrisbay / load_data.sh
Last active May 9, 2018 13:13
Load some data into a local Elasticsearch instance
curl -XPOST 'localhost:9200/twitter/tweets/1' -H 'Content-type:application/json' -d '
{
"date" : "2014-09-13",
"name" : "Mary Jones",
"tweet" : "Relational databases are so yesterday",
"user_id" : 2,
"likes": 1
}
'
@chrisbay
chrisbay / osm-basemap.json
Created March 14, 2018 16:08
Open Street Maps Config for stl-parks
{
"version": 8,
"name": "OSM Bright",
"metadata": {
"mapbox:type": "template",
"mapbox:groups": {
"1444849364238.8171": {
"collapsed": true,
"name": "Buildings"
},
POSTGRES_USER=zika_app_user
POSTGRES_PASS=somethingsensible
POSTGRES_DBNAME=zika
ALLOW_IP_RANGE=<0.0.0.0/0>
@chrisbay
chrisbay / application-h2.properties
Created January 9, 2018 14:07
Spring Boot config for H2 in-memory database
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.url=jdbc:h2:mem:test
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.H2Dialect
spring.jpa.hibernate.ddl-auto=update