Skip to content

Instantly share code, notes, and snippets.

View omedale's full-sized avatar
🎯
Focusing

Medale oluwafemi omedale

🎯
Focusing
  • Lagos, Nigeria
View GitHub Profile
@omedale
omedale / import_and_parse_remote_csv_rails.md
Created November 21, 2019 09:51 — forked from wrburgess/import_and_parse_remote_csv_rails.md
Import and parse remote csv with Rails
require 'csv'
require 'open-uri'

csv_text = open('http://www.vvv.hh.yyy.ggg/~hhhh/uuuu.csv')
csv = CSV.parse(csv_text, :headers=>true)
csv.each do |row|
  puts row
end
@omedale
omedale / readline_bundle_image_not_found.md
Created August 6, 2019 08:34 — forked from zulhfreelancer/readline_bundle_image_not_found.md
How to fix 'readline.bundle image not found' problem?

If you get error like this:

Running via Spring preloader in process 7662
/Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require': dlopen(/Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
  Referenced from: /Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
  Reason: image not found - /Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
@omedale
omedale / launch.sh
Created July 29, 2019 10:58 — forked from ltfschoen/launch.sh
Shell script that generates separate Terminal tabs to run a Ruby on Rails web server then automatically opens associated webpage in your web browser
#!/bin/bash
# File: ~/launch.sh
# Original Code Reference: http://dan.doezema.com/2013/04/programmatically-create-title-tabs-within-the-mac-os-x-terminal-app/
# New-BSD License by Original Author Daniel Doezema http://dan.doezema.com/licenses/new-bsd/
# Modified by Luke Schoen in 2017 to include loading new tabs for Rails Server and automatically open webpage in browser.
# References: https://developer.apple.com/library/content/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html
@omedale
omedale / bfs.rb
Created April 2, 2019 13:52 — forked from nazargulov/bfs.rb
# Put unvisited nodes on a queue
# Solves the shortest path problem: Find path from "source" to "target"
# that uses the fewest number of edges
# It's not recursive (like depth first search)
#
# The steps are quite simple:
# * Put s into a FIFO queue and mark it as visited
# * Repeat until the queue is empty:
# - Remove the least recently added node n
# - add each of n's unvisited adjacents to the queue and