Skip to content

Instantly share code, notes, and snippets.

View joemsak's full-sized avatar

Joe Sak joemsak

View GitHub Profile
@joemsak
joemsak / Gemfile
Last active January 26, 2024 18:59
Learn SQL the Hard Way Ex 6 in Ruby
source "https://rubygems.org"
ruby "3.3.0"
gem "activemodel"
gem "activesupport"
gem "sqlite3"
gem "pry"
admin, foo, bar
<div id="cycle_area">
<div>
<img src="img/appo.jpg" />
<h2>Appolicious</h2>
<h3>Find mobile apps you'll love</h3>
<p>Appolicious now has curated apps! As the mobile app landscape shifts and evolves, Appolicious stays on top with more app discovery features. Users can now create their own collection of applications, souping up the browsing experience. Go on, wrangle up your own set!</p>
<p><a href="http://www.appolicious.com">Visit website &#187;</a></p>
</div><!-- /one thing to cycle, loop this -->
<div>
<img src="img/abc.jpg" />
@joemsak
joemsak / rails.rb
Last active April 20, 2021 15:07
Dockerized Rails 6.1 Template
gem 'sidekiq'
gem 'redis'
gem 'email_validator', require: 'email_validator/strict'
gem 'bcrypt'
gem 'friendly_id'
gem "tailwindcss-rails"
gem_group :development, :test do
gem 'pry-rails'
@joemsak
joemsak / convert_duration_to_seconds.rb
Created November 12, 2020 20:18 — forked from natritmeyer/convert_duration_to_seconds.rb
Ruby ISO 8601 duration converter
require 'test/unit'
# implementation
class Duration
def in_seconds(raw_duration)
match = raw_duration.match(/PT(?:([0-9]*)H)*(?:([0-9]*)M)*(?:([0-9.]*)S)*/)
hours = match[1].to_i
minutes = match[2].to_i
seconds = match[3].to_f
seconds + (60 * minutes) + (60 * 60 * hours)
@joemsak
joemsak / profiles_controller.rb
Created August 17, 2020 17:38
app/controllers/concerns/profile_controller.rb
def update
#
# TODO: explore why location details errors appear order-dependent
# and unable to run in the error path
#
if setting_location_without_location_details?
handle_blank_location_error
elsif ProfileUpdating.execute(profile, permitted_params)
handle_successful_profile_update
else
query = "course"
original = {
"en"=>{
"courses"=>"Courses",
"layouts"=>{
"navigation"=>{
"desktop"=>{
"browse_courses"=>"Browse Courses",
"this_one"=>false
@joemsak
joemsak / .gitignore
Created February 15, 2020 18:53
.gitignore for merge conflict backups
.orig
@joemsak
joemsak / .gitconfig
Created February 15, 2020 18:15
.gitconfig for rerere (Reuse Recorded Resolution)
[rerere]
enabled = true
@joemsak
joemsak / .gitconfig
Created February 15, 2020 18:13
.gitconfig for setting up pull with rebase
[branch]
autosetuprebase = always