Skip to content

Instantly share code, notes, and snippets.

View gpolyn's full-sized avatar

Gallagher Polyn gpolyn

View GitHub Profile
def plot_loss(history: keras.callbacks.History, xlabel: str = None, ylabel: str = None, ylim: list = None):
  plt.plot(history.history['loss'], label='loss')
  plt.plot(history.history['val_loss'], label='val_loss')
  plt.ylim(ylim)
  plt.xlabel(xlabel)
  plt.ylabel(ylabel)
  plt.legend()
  plt.grid(True)
/**
* Copyright 2018 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
@gpolyn
gpolyn / .babelrc
Created May 16, 2018 21:30
next, web worker debug issue
{
"presets": [
[
"next/babel",
{
"styled-jsx": {
"plugins": [
"styled-jsx-plugin-postcss"
]
}
@gpolyn
gpolyn / camera_reporter.js
Last active June 25, 2016 21:39
Report on three.js camera and look at parameters
/** @namespace */
var THREEg = THREEg || {}
THREEg.CameraReporter = function (){
var msMin = 100;
var msMax = 0;
var container = document.createElement( 'div' );
/** @namespace */
var THREEg = THREEg || {}
THREEg.OrbitReporter = function (){
var msMin = 100;
var msMax = 0;
var container = document.createElement( 'div' );
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
* @author erich666 / http://erichaines.com
*/
// This set of controls performs orbiting, dollying (zooming), and panning.
// I have two scenes and I clear depth to handle visibility matter
animate(){
requestAnimationFrame( this._animate.bind(this) );
this._renderer.clear();
this._renderer.render( this._scene, this._camera );
this._renderer.clearDepth();
this._renderer.render( this._scene2, this._camera );
}
@gpolyn
gpolyn / Gemfile
Created March 15, 2016 20:23
github.com/Dwolla/dwolla-v2-ruby/tree/44bea580123ad914b184e54c65f80d05600d3d3d#usage doesn't give correct scopes in uat
source "https://rubygems.org"
ruby '2.1.2'
gem 'dwolla_v2', '~> 0.4'
source "https://rubygems.org"
ruby "2.1.2"
gem 'dwolla_v2', '~> 0.4'
gem 'dwolla_swagger', '~>1.0.0'
gem 'faker'
gem 'httparty'
@gpolyn
gpolyn / transfer-money-between-users.rb
Created March 10, 2016 21:44
attempting developers.dwolla.com/guides/transfer-money-between-users with dwolla_swagger gem
require 'dwolla_swagger'
require 'faker'
DwollaSwagger::Swagger.configure do |config|
config.host = 'api-uat.dwolla.com'
config.access_token = ENV['DWOLLA_UAT_ACCESS_TOKEN']
end
# B