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
# 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 |
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 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 |
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
# 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: |
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
class Foo | |
def self.say | |
p "hello from Foo" | |
end | |
end | |
module Bar | |
def self.say |
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
# $ rails new thud -m https://gist.github.com/radar/722911/raw/ | |
gem "rspec-rails", group: "test" | |
gem "pry" | |
gem "devise" |
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 ruby | |
# RubyLoCo Star Wars Hack Night | |
# Documentation https://swapi.co/documentation | |
require 'json' | |
require 'bundler/inline' | |
# true to install gems | |
gemfile ENV['INSTALL'] do | |
source 'https://rubygems.org' | |
gem 'typhoeus' |
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 ruby | |
# RubyLoCo Star Wars Hack Night | |
# Documentation https://swapi.co/documentation | |
require 'bundler/inline' | |
# true to install gems | |
gemfile false do | |
source 'https://rubygems.org' | |
gem 'httparty' |
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 ruby | |
# | |
# This goal of this RubyLoCo Puzzle is to generate an ascii | |
# American Flag. Try to come up with a unique way to generate | |
# the flag. Below is the easiest implementation. | |
# | |
# Ruby not required! Use any langauge and pair up! | |
# | |
# If you complete the task here are some more advanced ideas: | |
# make the flag colored |
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 you have a directory of files that look like: | |
# 2015-03-21 11.23.39.jpg | |
# 2015-04-15 09.55.20.jpg | |
# 2015-03-21 11.23.42.jpg | |
# 2015-05-12 13.14.59.png | |
# | |
# this Rakefile will move all the files into subdirectories for year/month | |
task :default do |task| | |
file_list = FileList['*.jpg', '*.png'] |
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
/gems/activemodel-3.2.13/lib/active_model/attribute_methods.rb:407 in "method_missing" | |
/gems/activerecord-3.2.13/lib/active_record/attribute_methods.rb:149 in "method_missing" | |
/app/models/delivery_method.rb:130 in "original_order_by" | |
/app/models/delivery_method.rb:165 in "order_by_has_passed?" | |
/app/models/delivery_method.rb:72 in "date" | |
/app/models/delivery.rb:109 in "delivery_dates" | |
/app/serializers/delivery_serializer.rb:12 in "delivery_dates" | |
(eval):6 in "_fast_attributes" | |
/gems/active_model_serializers-0.8.1/lib/active_model/serializer.rb:466 in "rescue in attributes" | |
/gems/active_model_serializers-0.8.1/lib/active_model/serializer.rb:454 in "attributes" |
NewerOlder