Skip to content

Instantly share code, notes, and snippets.

View teekaytech's full-sized avatar
👀
Looking for new opportunities

Taofeek Olalere teekaytech

👀
Looking for new opportunities
View GitHub Profile
@teekaytech
teekaytech / request.rb
Created February 27, 2022 17:53
chameleon_technical_exercise
##
# Hello hello!
#
# This is meant to be a quick (and fun?) sense-check of your Ruby!
#
# Notes:
# 0. How are you today? 👋
# 1. Feel free to download the CSV locally paste into irb or run this with `ruby requests.rb`!
# 2. We're loosely available to field questions on recruiting+engineering@trychameleon.com
# 3. Don't overanalyze your implementation/formatting/variable names/etc. do what comes naturally to you
@teekaytech
teekaytech / seeds.rb
Created December 2, 2021 09:47 — forked from seyhunak/seeds.rb
Rails - Import SQL file as seed
unless Rails.env.production?
connection = ActiveRecord::Base.connection
connection.tables.each do |table|
connection.execute("TRUNCATE #{table}") unless table == "schema_migrations"
end
sql = File.read('db/import.sql')
statements = sql.split(/;$/)
statements.pop

How to google bugs like a pro 🐜 👈😎👍

1. Introduction

After years of coding and debugging my code, I've had to search for a lot of bug fixes online. Because of this, I've come up up with multiple googling techniques. I'd like to share these techniques here, to help others save time while searching for code solutions online.

2. General search techniques

These are techniques that apply to any type of online search you want to do, not just coding. Later on I'll touch on the subject of how to deal with error messages, and code searches.

@teekaytech
teekaytech / gist:855afad831ccf50e31a641d60ea005e1
Created May 28, 2021 17:03 — forked from arjunvenkat/gist:1115bc41bf395a162084
Seeding a Rails database with a CSV file

How to seed a Rails database with a CSV file

1. Setup

First, Create a folder inside of lib called seeds

Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv

Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.