This is a Ruby on Rails application that helps users with benefits applications. The application uses:
- Ruby on Rails 8
- PostgreSQL database
- Bootstrap 5.3 for UI styling
- Hotwire (Turbo and Stimulus) for frontend interactivity
- RSpec for testing
It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime steps in:
>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000
| #!/bin/bash | |
| #Usage: | |
| #./find-links.sh #shows linked pages and orphans | |
| #./find-links.sh --html #shows linked pages and orphans with HTML links | |
| #./find-links.sh --md #shows linked pages and orphans with Markdown links | |
| #./find-links.sh --orphans #shows only orphans | |
| #./find-links.sh --orphans --html #shows only orphans with HTML links | |
| #./find-links.sh --linked #shows only linked pages | |
| #./find-links.sh --linked --html #shows only linked pages with HTML links |
| <?php | |
| /** | |
| * Is RTL | |
| * Check if there RTL characters (Arabic, Persian, Hebrew) | |
| * | |
| * @author Khaled Attia <[email protected]> | |
| * @param String $string | |
| * @return bool | |
| */ |
| #!/usr/bin/env bash | |
| read -p "GitHub username: " -ei $(git config --get github.user) USERNAME | |
| read -sp "GitHub password: " PASSWORD | |
| echo | |
| read -p "Submit pull request to user: " TO_USER | |
| read -p "Submit pull request to repository: " TO_REPO | |
| read -p "Submit pull request to branch: " -ei master TO_BRANCH | |
| read -p "Submit pull request from user: " -ei $USERNAME FROM_USER | |
| read -p "Submit pull request from branch: " FROM_BRANCH |
| /* | |
| Read more here: | |
| https://developer.mozilla.org/en/CSS/@-moz-document | |
| For more browser-specific hacks: | |
| http://paulirish.com/2009/browser-specific-css-hacks | |
| */ | |
| @-moz-document url-prefix() { | |
| /* Put your Firefox specific code here. */ |
| /* | |
| Nice to study. Original here http://www.20thingsilearned.com/js/twentythings.min.js | |
| */ | |
| var TT = TT || {}; | |
| TT.PAGE_WIDTH = 800; | |
| TT.PAGE_HEIGHT = 500; | |
| TT.PAGE_MIN_WIDTH = 1000; | |
| TT.PAGE_MIN_HEIGHT = 680; | |
| TT.PAGE_MARGIN_LEFT = 32; |