Skip to content

Instantly share code, notes, and snippets.

View jalbertbowden's full-sized avatar

albert jalbertbowden

View GitHub Profile
import os
import urllib.request
import urllib.parse
SLACK_API_ENDPOINT = 'https://slack.com/api/users.admin.invite'
HEADERS = {
'Access-Control-Allow-Origin': os.environ['ALLOWED_ORIGIN'],
'Access-Control-Allow-Credentials': 'true'
}
@jalbertbowden
jalbertbowden / map.geojson
Last active July 13, 2019 04:04
NOAA COOPS Active Current Stations in Virginia
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jalbertbowden
jalbertbowden / map.geojson
Last active July 11, 2019 03:21
Virginia Earthquakes - 1900-2019-07-10
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jalbertbowden
jalbertbowden / php-style-guide.md
Created July 2, 2019 01:32 — forked from ryansechrest/php-style-guide.md
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@jalbertbowden
jalbertbowden / make_gdrive_index.py
Created June 26, 2019 02:57 — forked from cmungall/make_gdrive_index.py
Generate HTML index of a synced google drive folder. For me this is faster to search and navigate than the clunky slow google web interface. Pretty hacky code but it works for me
#!/usr/bin/env python3
import os
import re
import logging
import click
# don't index these
excludes = {
'single_files',
'Icon',
@jalbertbowden
jalbertbowden / log.md
Last active June 18, 2019 12:46
laravel log

[2019-06-18 12:29:24] local.ERROR: Data missing {"exception":"[object] (InvalidArgumentException(code: 0): Data missing at /Users/albertbowden/Documents/RM3/vendor/nesbot/carbon/src/Carbon/Carbon.php:909)
[stacktrace]
#0 /Users/albertbowden/Documents/RM3/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(768): Carbon\Carbon::createFromFormat('Y-m-d H:i:s.u', '2019-06-18 12:2...')
#1 /Users/albertbowden/Documents/RM3/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(791): Illuminate\Database\Eloquent\Model->asDateTime('2019-06-18 12:2...')
#2 /Users/albertbowden/Documents/RM3/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(1115): Illuminate\Database\Eloquent\Model->fromDateTime('2019-06-18 12:2...')
#3 /Users/albertbowden/Documents/RM3/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(1076): Illuminate\Database\Eloquent\Model->originalIsEquivalent('upd

<?php
require 'vendor/autoload.php';
include $_SERVER["DOCUMENT_ROOT"] . '/admin/AlmaAPIClient.php';
include 'DMVDatabaseClient.php';
include 'ErrorList.php';
use Rakit\Validation\Validator;
/**
* Provides basic CSRF protection.
*
<?php
Class AlmaAPIClient {
const SUCCESS = "success";
const API_URL = 'https://api-na.hosted.exlibrisgroup.com/almaws/v1';
private $api_key;
public function __construct($key) {
@jalbertbowden
jalbertbowden / write-html.py
Created May 25, 2019 21:46
esri2geojson not complete
"""import json
from esridump.dumper import EsriDumper
d = EsriDumper('http://example.com/arcgis/rest/services/Layer/MapServer/1')
# Iterate over each feature
for feature in d:
print(json.dumps(feature))
d = EsriDumper('http://example.com/arcgis/rest/services/Layer/MapServer/2')