Skip to content

Instantly share code, notes, and snippets.

🍵

Gabe Martin-Dempesy gabetax

🍵
Block or report user

Report or block gabetax

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am gabetax on github.
  • I am gabetax (https://keybase.io/gabetax) on keybase.
  • I have a public key whose fingerprint is 1EFD 47AF EC3D 547B A20D 9E55 BF32 3A32 8D07 3EFA

To claim this, I am signing this object:

@gabetax
gabetax / geekcode.sig
Last active Apr 2, 2016
My geek code from 1999
View geekcode.sig
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/S/M d--(!) s:>:+++ a--- C++++>$ UBL++++ P+>++ L++++ E--- W++ N+ o?
K++ w@ !O M !V PS+++ PE@ Y(+) PGP(+)>+++ t+@ 5 X++ R>+ tv++>! b DI+ D++
G+ e>++ h- r*>+ y?>$
------END GEEK CODE BLOCK------
@gabetax
gabetax / resque_redis_keys.md
Created Mar 17, 2016
Keys Resque manages in Redis
View resque_redis_keys.md

Resque Redis keys:

  • resque:workers => SET of "host:pid:raw,queue,list" strings
  • resque:worker:host:pid:raw,queue,list => STRING JSON of job payload for a running worker. Set by #working_on.
  • resque:worker:host:pid:raw,queue,list:started => STRING timestamp when worker booted. Static.
  • resque:stat:failed:host:pid:raw,queue,list => STRING count of failed jobs
  • resque:stat:processed:host:pid:raw,queue,list => STRING count of successful? jobs
@gabetax
gabetax / as_callbacks_logging.rb
Created Feb 12, 2016
Log which callback is being run before running it
View as_callbacks_logging.rb
ActiveSupport::Callbacks::Callback
class ActiveSupport::Callbacks::Callback
def start(key=nil, object=nil)
return if key && !object.send("_one_time_conditions_valid_#{@callback_id}?")
# options[0] is the compiled form of supplied conditions
# options[1] is the "end" for the conditional
#
case @kind
when :before
View measure.rb
require 'benchmark'
def measure(gc: false, times: 1000, &block)
GC.start
GC.disable if gc
gc_key = if RUBY_VERSION > 2.2
:total_allocated_objects
else
:total_allocated_object
View drbike.ino
#include <FastLED.h>
//#define LED_PIN 5
#define DATA_PIN 9
#define CLOCK_PIN 8
#define NUM_LEDS 300
#define BRIGHTNESS 64
#define LED_TYPE APA102
#define COLOR_ORDER BGR
CRGB leds[NUM_LEDS];
@gabetax
gabetax / json_pluck.rb
Last active Feb 1, 2016
Pluck values out of JSON logs
View json_pluck.rb
#!/usr/bin/env ruby
require 'json'
# Usage:
# head production.log.json | ruby json_pluck.rb time,session,message
# colorize output when going to stdout or if explicitly requested (e.g. `| less -r`)
color = $stdout.tty?
color = true if ARGV.first == '-c' && ARGV.shift
@gabetax
gabetax / consul travis.yml
Created Jun 10, 2015
Consul support on Travis-CI
View consul travis.yml
sudo: false
env:
global:
- CONSUL_VERSION=0.5.0
- CONSUL_DC=dev1
- CONSUL_DIR=$HOME/consul_$CONSUL_VERSION
before_script:
- 'if [[ ! -f $CONSUL_DIR/consul ]]; then (mkdir -p $CONSUL_DIR && cd $CONSUL_DIR && wget https://dl.bintray.com/mitchellh/consul/${CONSUL_VERSION}_linux_amd64.zip && unzip ${CONSUL_VERSION}_linux_amd64.zip); fi'
- $CONSUL_DIR/consul --version
- $CONSUL_DIR/consul agent -server -bootstrap-expect 1 -data-dir /tmp/consul -dc=$CONSUL_DC &
@gabetax
gabetax / gist:b81d097792364d88eff0
Created Apr 16, 2015
SSL Certificate subject collision with alternate public keys / subject key identifiers
View gist:b81d097792364d88eff0
-----BEGIN CERTIFICATE-----
MIIFLjCCBBagAwIBAgIQAw6VKU2uwSwDzzGrWwJx1zANBgkqhkiG9w0BAQUFADBv
MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk
ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow
YjELMAkGA1UEBhMCVVMxITAfBgNVBAoTGE5ldHdvcmsgU29sdXRpb25zIEwuTC5D
LjEwMC4GA1UEAxMnTmV0d29yayBTb2x1dGlvbnMgQ2VydGlmaWNhdGUgQXV0aG9y
aXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5Lx+kjBtxtiOKwu8
Rs7gJ5be3vn6EtM8M3OzBC+8cYzln7YiYD5fXc4J/4IMG5pRUBomid3VYV0Z3BIP
LQqiQ10X0DSSIOpzzzgsBiYJenL3+lAy+MKT02miI85Bsczk1R820Yo6+Ixj4hRZ
View aca_6004_valid_submission.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2008 sp1 (http://www.altova.com)-->
<tns:submission xsi:schemaLocation="aca ACASubmission.xsd" xmlns:tns="aca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<submissionYear>2011</submissionYear>
<business>
<businessType>Manufacturer</businessType>
<businessName>Business Name xyz</businessName>
</business>
<practitionerGroups>
<practitionerGroup>
You can’t perform that action at this time.