Skip to content

Instantly share code, notes, and snippets.

View edpaget's full-sized avatar

Edward Paget edpaget

  • Chicago, IL
View GitHub Profile

Keybase proof

I hereby claim:

  • I am edpaget on github.
  • I am edflairco (https://keybase.io/edflairco) on keybase.
  • I have a public key ASBFNKDi5e1NvD1R3ebxKj-pUewGBpvEIfcjhmw1fVR_Ogo

To claim this, I am signing this object:

@edpaget
edpaget / docker-compose.yml
Last active May 14, 2018 13:34
Kong docker-compose
version: '2.1'
services:
kong-database:
image: postgres:9.5
environment:
- POSTGRES_USER=kong
- POSTGRES_DB=kong
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
(defui ChildComponent
static om/IQuery
(query [this]
[:id :type :name]))
(defui ParentComponent
static om/IQuery
(query [this]
[{[:things _] [{:another-key (om/get-query ChildComponent)}]}]))
@edpaget
edpaget / classification_dups.py
Last active August 29, 2015 14:27
Remove duplicate classifications
classification_dict = dict()
for classification in classifications:
key = str(classification.user_id) + str(classification.subject_ids[0])
if not key in classification_dict:
classification_dict[key] = classification
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title>
<script type="text/javascript" charset="utf-8" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {
@edpaget
edpaget / postgresql_reconnect.rb
Created June 30, 2015 17:41
Postgresql Reconnect Error
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
# Activate the gem you are reporting the issue against.

Checklist for Tomorrow

  • Add zooniverse.org & www.zooniverse.org to maintenance page CF distribution
  • Add redirect from zooniverse.org/password/reset to zooniverse.org/#/reset-password
  • Add redirect from zooniverse.org/projects/current to zooniverse.org/#/users
  • Add redirect from zooniverse.org/signup to zooniverse.org/#/accounts/register
  • Add redirect from zooniverse.org/api/events to panotpes.zooniverse.org/api/events
  • Reset sign_in_count
  • Build Ouroboros AMI with PR https://github.com/zooniverse/Ouroboros/pull/198
  • Build Login AMI with PR https://github.com/zooniverse/Login/pull/1
# Checklist for Tomorrow
[ ] Add zooniverse.org & www.zooniverse.org to maintenance page CF distribution
[ ] Add redirect from zooniverse.org/password/reset to zooniverse.org/#/reset-password
[ ] Add redirect from zooniverse.org/projects/current to zooniverse.org/#/users
[ ] Build Ouroboros AMI with PR https://github.com/zooniverse/Ouroboros/pulls/198
[ ] Build Login AMI with PR https://github.com/zooniverse/Login/pulls/1
[ ] Tweet that Zooniverse will be down for maintenance for 30 minutes to 1 hour
[ ] Redirect zooniverse.org & www.zooniverse.org to maintenance.zooniverse.org
[ ] Migrate users that have changed since Tuesday
WITH RECURSIVE rand(ids, id, done) AS (
SELECT ARRAY[]::int[], sub.id, 0 FROM (SELECT t.id FROM test t WHERE t.name = 'asdf' AND t.id = ceiling(random() * 8)::integer) AS sub
UNION ALL
SELECT (n.ids || n.id), sub.id, done+1 FROM rand n, (SELECT t.id FROM test t WHERE t.name = 'asdf' AND t.id = ceiling(random() * 8)::integer) AS sub WHERE NOT done = 5
)
SELECT n.* FROM rand n;
SELECT t.* FROM test t, rand n WHERE t.id = ANY(n.ids) LIMIT 20;
@edpaget
edpaget / subquery_bug_test.rb
Created January 8, 2015 22:50
Rails 4.2 Subquery Bug
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'arel', github: 'rails/arel'
gem 'sqlite3'
GEMFILE
system 'bundle'
end