I hereby claim:
- I am Narnach on github.
- I am narnach (https://keybase.io/narnach) on keybase.
- I have a public key whose fingerprint is 7655 6328 F92B 8BAC 788C DB71 AF8B 92CD AB84 DCD1
To claim this, I am signing this object:
# lib/capistrano/tasks/appsignal.cap | |
require 'appsignal' | |
require 'appsignal/marker' | |
namespace :appsignal do | |
task :deploy do | |
env = fetch(:rails_env, fetch(:rack_env, 'production')) | |
user = ENV['USER'] || ENV['USERNAME'] |
I hereby claim:
To claim this, I am signing this object:
# Add this to your Gemfile: | |
# | |
# # Session store built on top of ActiveRecord | |
# gem 'activerecord-session_store', github: 'rails/activerecord-session_store' | |
# # C-based parser backend for multi_json | |
# gem 'oj' | |
# # Unified API for parsing JSON | |
# gem 'multi_json' | |
# | |
class Session < ActiveRecord::SessionStore::Session |
07/04/14 12:28:14,229 Spotify Helper[3900]: Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650 | |
07/04/14 12:28:14,353 Spotify Helper[3900]: The function `CGFontSetShouldUseMulticache' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance. | |
07/04/14 12:28:44,031 Spotify Helper[3903]: Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650 | |
07/04/14 12:28:44,293 Spotify Helper[3903]: The function `CGFontSetShouldUseMulticache' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance. |
# Add this to the very TOP of config/application.rb, before the first statement | |
require 'pp' | |
module OSCount | |
def self.count(msg, force_count: false) | |
return if ENV['RAILS_ENV'] == 'test' | |
count = ObjectSpace.count_objects | |
last_count = Thread.current['OSCount.last_count'] | |
Thread.current['OSCount.last_count'] = count | |
show_count = last_count.nil? | |
show_count = true if force_count |
# This is motivated/inspired by Avdi Grimm's post on Boolean Externalties | |
# | |
# http://devblog.avdi.org/2014/09/17/boolean-externalities/ | |
# | |
# In his post he asks the question: if a predicate returns false, why does it do so? | |
# If you chain a lot of predicates, it's hard to figure out why you get the answer you get. Consider this example: | |
# This implements some simple chained predicate logic to determine if the object is scary. | |
class SimpleBoo | |
def scary? |
[ 2820] WARN - om.intellij.util.ProfilingUtil - YourKit controller initialization failed | |
java.lang.Exception: To profile application, you should run it with the profiler agent | |
at com.yourkit.api.Controller.getUsedPort(Controller.java:158) | |
at com.yourkit.api.Controller.<init>(Controller.java:83) | |
at com.intellij.util.ProfilingUtil.<clinit>(ProfilingUtil.java:57) | |
at com.intellij.util.CaptureMemorySnapshotAction.update(CaptureMemorySnapshotAction.java:25) | |
at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:113) | |
at com.intellij.openapi.actionSystem.impl.Utils.a(Utils.java:188) | |
at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:139) | |
at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:164) |
$ cap production deploy | |
DEBUG [26af543f] Running /usr/bin/env [ ! -d /usr/local/rbenv/versions/2.1.5 ] as user@example.org | |
DEBUG [26af543f] Command: [ ! -d /usr/local/rbenv/versions/2.1.5 ] | |
DEBUG [26af543f] Finished in 1.506 seconds with exit status 1 (failed). | |
Would you like to enable statistics? Here is an example message we would | |
send: | |
1|2015-01-27T16:10:07+01:00|2.1.5|x86_64-darwin14.0|3.3.5|ef0abd3f | |
Do you want to enable statistics? (y/N): |
#!/usr/bin/env ruby | |
# Based on https://gist.github.com/choonkeat/4277277 | |
# | |
# Not sure what the deal was with all that SSL stuff in there, but it was the cause content fetching did not work. | |
# Replaced it with plain old open-uri and it just works. | |
require 'net/https' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'json' |
#!/usr/bin/env ruby | |
# Goal: | |
# I want to overwrite an existing method on a class by using a module, | |
# instead of opening up the class and overwriting the method. | |
# | |
# Problem: | |
# Modules are treated kinda like a superclass. | |
# This means you can't use it to override a method, | |
# because it lies further away in the method call chain. | |
# |