Skip to content

Instantly share code, notes, and snippets.

View cmar's full-sized avatar

Chris Mar cmar

  • CustomInk
  • Northern, VA
  • X @cmar
View GitHub Profile
@cmar
cmar / prepended.rb
Last active May 11, 2017 12:52
example of prepended class methods
class Foo
def self.say
p "hello from Foo"
end
end
module Bar
def self.say
@cmar
cmar / docker-compose.yml
Last active May 21, 2017 13:10
docker-compose.yml
# add this file to your project and run
# docker-compose up
# point your database.yml to postgres on localhost:5432
version: '2'
services:
db:
image: postgres
ports:
- "5432:5432"
environment:
@cmar
cmar / decipher.rb
Last active May 4, 2018 17:00
Use AWS Rekognition to Translate binary code from screenshot
#!/usr/bin/env ruby
# You will need to setup your aws keys in your ENV
# AWS_SECRET_ACCESS_KEY
# AWS_ACCESS_KEY_ID
# and also enable the user to have access to Rekognition:detect_text in IAM
require 'aws-sdk'
# Screenshot from email https://s3.amazonaws.com/spdev/inkovate-binary-2018.jpg
@cmar
cmar / reward.py
Created December 5, 2018 13:24
Example Deep Racer Reward Function
# example reward function for reinforcement training
def reward_function (on_track, x, y, distance_from_center, car_orientation, progress,
steps, throttle, steering, track_width, waypoints, closest_waypoint):
import math
marker_1 = 0.1 * track_width
marker_2 = 0.25 * track_width
marker_3 = 0.5 * track_width