Skip to content

Instantly share code, notes, and snippets.

Dave Mox themoxman

Block or report user

Report or block themoxman

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 themoxman on github.
  • I am davemox (https://keybase.io/davemox) on keybase.
  • I have a public key ASAD-sH241NWoAtdF-nTTv79YQz4NHV5Tk3u2cktHwlU0Ao

To claim this, I am signing this object:

View put_env_to_s3
#!/usr/bin/env ruby
require 'aws-sdk'
# initialize S3 client
s3_client = Aws::S3::Client.new(region: 'us-east-1')
# initialize KMS client
kms_client = Aws::KMS::Client.new(region: 'us-east-1')
View Dockerfile
FROM codeship/ruby
MAINTAINER Dave Mox <dave.e.mox@gmail.com>
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
vim
COPY Makefile /src/
View metaprogramming.rb
16:41:30 davemox@Daves-MBP $ pry
[1] pry(main)> module Test
[1] pry(main)* def test
[1] pry(main)* puts "module Test"
[1] pry(main)* end
[1] pry(main)* end
=> :test
[2] pry(main)> class Testy
[2] pry(main)* prepend Test
[2] pry(main)* def test
@themoxman
themoxman / colorscheme_changer.vim
Last active Aug 29, 2015
Press F8 or `:NC` (next color) to change and show current colorscheme.
View colorscheme_changer.vim
" colors from https://github.com/flazz/vim-colorschemes
let s:mycolors = ['256-jungle', '3dglasses', 'BlackSea', 'C64', 'Chasing_Logic', 'ChocolateLiquor', 'ChocolatePapaya', 'CodeFactoryv3', 'DevC++', 'Monokai-chris', 'Monokai', 'MountainDew', 'PapayaWhip', 'SlateDark', 'Tomorrow-Night-Blue', 'Tomorrow-Night-Bright', 'Tomorrow-Night-Eighties', 'Tomorrow-Night', 'Tomorrow', 'abra', 'adam', 'adaryn', 'adobe', 'adrian', 'advantage', 'af', 'aiseered', 'anotherdark', 'ansi_blows', 'apprentice', 'aqua', 'ashen', 'asmanian_blood', 'astronaut', 'asu1dark', 'atom', 'automation', 'autumn', 'autumnleaf', 'babymate256', 'badwolf', 'base16-atelierdune', 'basic', 'bayQua', 'baycomb', 'bclear', 'beachcomber', 'beauty256', 'bensday', 'billw', 'biogoo', 'black_angus', 'blackbeauty', 'blackboard', 'blackdust', 'blacklight', 'blazer', 'blink', 'blue', 'bluechia', 'bluedrake', 'bluegreen', 'blueprint', 'blueshift', 'bluez', 'blugrine', 'bmichaelsen', 'bocau', 'bog', 'borland', 'breeze', 'brookstream', 'brown', 'bubblegum', 'bur
View singleton_pattern.rb
16:27:29 davemox@Daves-MBP $ irb
>> class Configuration; def self.instance; @instance ||= new; end; def self.reset!; @instance = nil; end; end
=> :reset!
>> Configuration.new
=> #<Configuration:0x007fba691ff6a0>
>> Configuration.new
=> #<Configuration:0x007fba691f6af0>
>> Configuration.new
=> #<Configuration:0x007fba691ee788>
>> Configuration.new
View struct_inheritance.rb
15:45:31 davemox@Daves-MBP $ irb
>> s = Struct.new
ArgumentError: wrong number of arguments (0 for 1+)
from (irb):1:in `new'
from (irb):1
from /Users/davemox/.rubies/ruby-2.2.0/bin/irb:11:in `<main>'
>> s = Struct.new(:foo, :bar)
=> #<Class:0x007fc9db83a4a8>
>> s.name
=> nil
View philly.rb
require "json"
require "nokogiri"
require "open-uri"
require "pry"
require "httparty"
response = HTTParty.get("http://api.meetup.com/2/rsvps?event_id=195138082&order=event&rsvp=yes&desc=false&offset=0&photo-host=public&format=json&page=500&fields=&sig_id=38456672&sig=c4193d8a8fa47590c330f861d061cc6bf3d0d7b0")
View gist:abc21c757629fd49efcc
~/Library/Mnemosyne
23:28:55 davemox@Daves-MacBook-Pro $ cat SGAS.db-journal
��
��log.txHT�
��lo���0n2HT�SQLite format 3@ !-������
Ά��0SQLite format 3@ !-������ !-������
View rspec_expectations.rb
# example from: https://relishapp.com/rspec/rspec-mocks/v/2-14/docs/
# wrote the code to make their example spec pass
class Account
attr_accessor :logger
def close
logger.account_closed(self)
end
You can’t perform that action at this time.