Skip to content

Instantly share code, notes, and snippets.

View connorshea's full-sized avatar
:shipit:
Shipping

Connor Shea connorshea

:shipit:
Shipping
View GitHub Profile
# Copyright (c) 2023 Facenapalm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@AnthonySuper
AnthonySuper / message.rb
Created May 1, 2017 23:20
Lets you see a history of the names in a group chat
#!/usr/bin/env ruby
require 'sqlite3'
path = File.expand_path("~/Library/Messages/chat.db")
db = SQLite3::Database.new path
db.results_as_hash = true
r = db.execute(%{SELECT chat.display_name, chat.ROWID FROM chat
WHERE chat.display_name IS NOT NULL AND
@grantspeelman
grantspeelman / Gemfile
Last active December 16, 2020 13:11
Example Gemfile files preparing for the next rails upgrade (https://grant-ps.blog/2017/07/03/upgrading-ruby-on-rails-in-smallish-steps/)
@next_upgrade ||= false
source 'https://rubygems.org'
if @next_upgrade
gem 'rails', '6.0.0.rc2'
else
gem 'rails', '~> 5.2.0'
end
# rest of gems below ....
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active October 30, 2024 05:56
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@seyhunak
seyhunak / devise_helper.rb
Created September 16, 2013 10:50
Devise Error Messages Twitter Bootstrap style
# /app/helpers/devise_helper.rb
module DeviseHelper
def devise_error_messages!
return '' if resource.errors.empty?
messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join
sentence = I18n.t('errors.messages.not_saved',
count: resource.errors.count,
resource: resource.class.model_name.human.downcase)
@szimek
szimek / presentation.md
Created January 24, 2012 09:51
HTTP caching in Rails

HTTP caching

Kinds of caches

  • Browser
  • Proxy
  • Gateway

TODO Difference between proxy and gateway caches.

@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one