Skip to content

Instantly share code, notes, and snippets.

View nickcoyne's full-sized avatar
👾

Nick Coyne nickcoyne

👾
View GitHub Profile
@nickcoyne
nickcoyne / arm-mysql2.md
Created November 12, 2023 17:30
Apple silicon mysql2 install
@nickcoyne
nickcoyne / curl_cookbook.md
Created September 8, 2019 16:28
Curl Cookbook
@nickcoyne
nickcoyne / discourse_notifications.json
Created April 30, 2017 00:17
Discourse notifications response
{"notifications":[{"id":74,"notification_type":9,"read":false,"created_at":"2017-04-18T16:36:41.618Z","post_number":5,"topic_id":21,"slug":"lets-have-fun-here","data":{"topic_title":"Let's have fun here!","original_post_id":59,"original_post_type":1,"original_username":"abi","display_username":"4 replies"}},{"id":48,"notification_type":12,"read":true,"created_at":"2017-01-06T17:07:00.089Z","post_number":null,"topic_id":null,"slug":null,"data":{"badge_id":1,"badge_name":"Basic User","badge_slug":"basic","username":"nick"}},{"id":30,"notification_type":12,"read":false,"created_at":"2017-01-05T21:01:52.450Z","post_number":null,"topic_id":null,"slug":null,"data":{"badge_id":13,"badge_name":"First Flag","badge_slug":"first-flag","username":"nick"}},{"id":27,"notification_type":12,"read":false,"created_at":"2017-01-05T20:56:51.165Z","post_number":null,"topic_id":null,"slug":null,"data":{"badge_id":11,"badge_name":"First Like","badge_slug":"first-like","username":"nick"}},{"id":18,"notification_type":6,"read":true,"
var timoutWarning = 60000; // Display warning in 1 min.
var timoutNow = 60000; // Warning has been shown, give the user 1 minute to interact
var logoutUrl = '/timeout'; // URL to logout page.
var warningTimer;
var timeoutTimer;
// Start warning timer.
function StartWarningTimer() {
warningTimer = setTimeout("IdleWarning()", timoutWarning);
class @App.Components.TempUserTimer
constructor: ->
@timeoutWarning = 10000 # Display warning in 1 min.
@timeoutNow = 60000 # Warning has been shown, give the user 1 minute to interact
@logoutUrl = '/timeout' # URL to logout page.
# Button click handlers
# close page
$(document).on 'click', '.js-temp-user-logout', =>
@timeout()
EsRejectedExecutionException[rejected execution (queue capacity 50) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1@bfe2356];
EsRejectedExecutionException[rejected execution (queue capacity 50) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1@420985d9]
EsRejectedExecutionException[rejected execution (queue capacity 50) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1@48c29c4a];
2016-02-29T11:57:37+00:00 {"error":"EsRejectedExecutionException[rejected execution (queue capacity 200) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1@70475c64]","status":429}
2016-02-29T11:57:37+00:00 {"error":"RemoteTransportException[[dwalin-1][inet[/10.0.1.109:9300]][indices:data/write/index]]; nested: EsRejectedExecutionException[rejected execution (queue capacity 200) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1@3a9b376c]; ","status":429}
2016-02-29T11:57:37+00:00 {"error":"EsRejectedExecutionException[rejected execution (queue capacity 200) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1@765fa2ba]","status":429}
2016-02-29T11:57:23+00:00 {"error":"RemoteTransportException[[dwalin-1][inet[/10.0.1.109:9300]][indices:data/write/index]]; nested: EsRejectedExecutionException[rejected execution (queue capacity 200) on org.elasticsearch
@nickcoyne
nickcoyne / gist:ecfcf33aad48eaa9f5b1
Created May 19, 2015 20:46
derailed exec perf:mem (rails 3.2.21/ruby 2.1.5) 20 May 2015
$ RAILS_ENV=profiling bundle exec derailed exec perf:mem
Your Gemfile lists the gem dotenv-rails (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Booting: profiling
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from mon_synchronize at /Users/nick/.rbenv/versions/2.1.5/lib/ruby/2.1.0/monitor.rb:211)
You did not specify how you would like Rails to report deprecation notices for your profiling environment, please set config.active_support.deprecation to :log, :notify or :stderr at config/environments/profiling.rb
Endpoint: "/"
/Users/nick/.rbenv/versions/2.1.5/gem
@nickcoyne
nickcoyne / gist:6082437
Created July 25, 2013 18:29
Allow the cloudinary migration tool to run on Heroku, by using MySQL instead of sqlite.
require 'cloudinary'
require 'cloudinary/migrator'
class DbMigrator < Cloudinary::Migrator
def self.init
return if @@init
@@init = true
require 'tempfile'
end
@nickcoyne
nickcoyne / deploy.rake
Created September 25, 2012 20:24 — forked from njvitto/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]