🏃♂️
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def transform_payload(opts) | |
ex_msg = opts[:payload]['data'][:body][:trace][:exception][:message] rescue nil | |
if ex_msg =~ /#<(.*)(:0x[a-f0-9]{8})>$/ | |
# Convert | |
# "undefined method `blow_up!' for #<Customer:0x7b417d08>" | |
# to | |
# "undefined method `blow_up!' for #<Customer>" | |
# to prevent rollbar storms when each message has a different hash | |
opts[:payload]['data'][:body][:trace][:exception][:message].gsub! $2, '' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import urlparse | |
import urllib2 | |
import json | |
import os | |
import pprint | |
API_ENDPOINT = "https://chapi.cloudhealthtech.com/pulse/" | |
API_KEY = os.getenv('API_KEY') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'march_hare' | |
connection = MarchHare.connect(:host => 'localhost', :thread_pool_size => 8) | |
channel = connection.create_channel | |
channel.prefetch = 10 | |
exchange = channel.exchange('test', :type => :direct) | |
queue = channel.queue('hello.world') | |
queue.bind(exchange, :routing_key => 'xyz') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group :engines do | |
gem 'my_engine' | |
gem 'another_engine' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This gives us the ability to get BIGINT PK's in schema.rb | |
# It also plays nice with the schema_plus gem | |
module MyCompany | |
module ActiveRecord | |
module SchemaDumper | |
def self.included(base) #:nodoc: | |
base.class_eval do | |
private | |
alias_method_chain :table, :bigint_support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.Thread.State: RUNNABLE | |
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) | |
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) | |
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:225) | |
at sun.nio.ch.IOUtil.read(IOUtil.java:198) | |
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:375) | |
- locked <0x0000000689667010> (a java.lang.Object) | |
at org.jruby.ext.openssl.SSLSocket.readAndUnwrap(SSLSocket.java:516) | |
at org.jruby.ext.openssl.SSLSocket.read(SSLSocket.java:504) | |
at org.jruby.ext.openssl.SSLSocket.do_sysread(SSLSocket.java:616) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> create table test_enum (action varchar(255)); | |
Query OK, 0 rows affected (0.05 sec) | |
mysql> insert into test_enum set action="create"; | |
Query OK, 1 row affected (0.04 sec) | |
mysql> insert into test_enum set action="delete"; | |
Query OK, 1 row affected (0.00 sec) | |
mysql> insert into test_enum set action="update"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.startup(function() { | |
Meteor.Keybindings.addOne('a', function() { | |
console.log('You pressed a'); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/lardcanoe/repo.git | |
cd repo | |
git remote add upstream https://github.com/repo/repo.git | |
git pull --rebase upstream | |
git pull --rebase upstream devel | |
git checkout -b repo_branch origin | |
git add new_file | |
git commit | |
git push origin repo_branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if device_name and instance: | |
try: | |
volume.add_tag("Name", "%s - %s" % (inst.id, device_name)) |