@pagy, @activities = pagy(Activity.order(created_at: :desc).includes(:user, :trackable), limit: 4)
respond_to do |format|
format.html
format.json { render json: { entries: render_to_string(partial: "activities/activity", collection: @activities, formats: [ :html ]), pagination: view_context.pagy_nav(@pagy) } }
end
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
PROFANITY_LIST = [ | |
"aclit", "adick", "aids", "alabama porch monkey", "anal intruder", | |
"anal invader", "analicker", "anus", "4r5e", "5h1t", "5hit", "a55", | |
"anal", "ar5e", "arrse", "arse", "ass", "as$", "ass bandit", "ass clown", | |
"ass face", "ass fucker", "ass hole", "ass load", "ass much", "ass out", | |
"ass packer", "ass reamer", "ass whacker", "ass wipe", "assbandit", | |
"assclown", "asscrack", "assed out", "assface", "assfucker", "asshole", | |
"asslicker", "assload", "assmunch", "assout", "asspacker", "assreamer", | |
"asswhacker", "asswipe", "baby batter", "babybatter", "ball breaker", | |
"ball buster", "baller", "balling", "bat shit", "batshit", "bearded clam", |
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
require 'digest' | |
SLUG_DEFAULT = 4 | |
SAFESTRING = "BDFGHJKLMNPQRTVWXYZbdfghjkmnpqrtvwxyz26789".freeze | |
def encrypt_to_slug(number, size: SLUG_DEFAULT, alphabet: SAFESTRING) | |
non_numeric_set = alphabet.gsub(/[0-9]/, '') # Characters without digits | |
# Step 1: Hash the number (using SHA256) | |
hash = Digest::SHA256.digest(number.to_s) |
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
[data-color='blue'][data-color-scheme='light'] { | |
--primary: #445E91; | |
--surface-tint: #445E91; | |
--on-primary: #FFFFFF; | |
--primary-container: #D8E2FF; | |
--on-primary-container: #001A42; | |
--secondary: #575E71; | |
--on-secondary: #FFFFFF; | |
--secondary-container: #DBE2F9; | |
--on-secondary-container: #141B2C; |
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 | |
require 'mail' | |
require 'fileutils' | |
# Check if a command line argument is provided | |
if ARGV.length < 1 | |
puts "Usage: ruby send_to-kindle.rb <directory containing epub files>" | |
exit 1 |
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
# frozen_string_literal: true | |
module Slug | |
extend ActiveSupport::Concern | |
def self.included(base) | |
base.extend ClassMethods | |
base.before_create :set_slug | |
end | |
def to_param |
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
zucchini zoology zoologist zoo zone zombie zither zipper zinc ziggurat zero zephyr zen zebrafish zebra zampone yurt yoyo youth yourself youngster young yolk yoke yogurt yoga yin yew yesterday yellowjacket yellow yeast year yawl yarn yarmulke yard yang yam yak yahoo yacht xylophone wrong writing writer wrist wrinkle wriggler wrestler wrench wren wrecker wreck wrapping wrapper wraparound wrap wound worth worshiper worship worry worm world workshop workplace workout working workhorse workforce worker workbench work wording word woolens wool woodwind woodshed woodland woodchuck wood wont wonder wombat woman wolf wok witness withdrawal witchhunt witch wit wisteria wish wiseguy wisdom wiring wiretap wire winter winner wink wingtip wingman wing winery wine windshield windscreen window windchime windage wind win willow willingness will wildlife wildflower wilderness wildebeest wild wife width widow widget wick whorl wholesaler wholesale whole white whistle whisper whiskey whisker whirlwind whirlpool whip whey whelp w |
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
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
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
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
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
CREATE TABLE `states` ( | |
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | |
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, | |
`code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, | |
`created_at` timestamp NULL DEFAULT NULL, | |
`updated_at` timestamp NULL DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; | |
NewerOlder