- You MUST NOT try and generate a Rails app from scratch on your own by generating each file. For a NEW app you MUST use
rails new
first to generate all of the boilerplate files necessary. - Create an app in the current directory with
rails new .
- Use Tailwind CSS for styling. Use
--css tailwind
as an option on therails new
call to do this automatically. - Use Ruby 3.2+ and Rails 8.0+ practices.
- Use the default Minitest approach for testing, do not use RSpec.
- Default to using SQLite in development.
rails new
will do this automatically but take care if you write any custom SQL that it is SQLite compatible. - An app can be built with a devcontainer such as
rails new myapp --devcontainer
but only do this if requested directly. - Rails apps have a lot of directories to consider, such as app, config, db, etc.
- Adhere to MVC conventions: singular model names (e.g., Product) map to plural tables (products); controllers are plural.
- Guard against incapable browsers accessing controllers with `allo
--- /etc/ssl/openssl.cnf~original 2022-03-16 08:35:51.000000000 +0000 | |
+++ /etc/ssl/openssl.cnf 2022-05-04 02:37:30.336530711 +0000 | |
@@ -56,6 +56,7 @@ | |
# List of providers to load | |
[provider_sect] | |
default = default_sect | |
+legacy = legacy_sect | |
# The fips section name should match the section name inside the | |
# included fipsmodule.cnf. | |
# fips = fips_sect |
This is just some code I recently used in my development application in order to add token-based authentication for my api-only rails app. The api-client was to be consumed by a mobile application, so I needed an authentication solution that would keep the user logged in indefinetly and the only way to do this was either using refresh tokens or sliding sessions.
I also needed a way to both blacklist and whitelist tokens based on a unique identifier (jti)
Before trying it out DIY, I considered using:
From: https://www.reddit.com/r/programming/comments/8jjq33/11_best_programming_fonts/dz0xxs5/ | |
------ | |
o0O s5S z2Z !|l1Iij {([|})] .,;: ``''"" | |
a@#* vVuUwW <>;^°=-~ öÖüÜäÄßµ \/\/ | |
the quick brown fox jumps over the lazy dog | |
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG | |
0123456789 &-+@ for (int i=0; i<j; ++i) { } |
import _ from 'underscore'; | |
import fetch from 'isomorphic-fetch' | |
class API { | |
getCSRFToken() { | |
return _.find(document.getElementsByTagName('meta'), (meta) => { | |
return meta.name === 'csrf-token' | |
}).content | |
} |
React_On_Rails is an awesome library that integrates React + Rails + Webpack, with boilerplate to quickly get you up and running on a new project. React-Refetch is also another great library that makes reading and writing data to the server in React seamless. My goal here is to develop an architecture leveraging these two libraries that accomplishes three goals:
- Simple
- Easy to maintain
- Scalable
To accomplish this, our architecture will leverage React-Refetch and Rails routing to expose each component to the data needed on each given page, using our server data as the single source of truth, therefore minimizing or, idealy, completely removing our use of state to modify data on many pages. This reduces the fragile nature of offloading a batch of data to one large root component and dispersing it among nested sub-components. This also allows us to always have a 1-to-1 relationship betwee
Short url: caseywatts.com/mediawikionheroku
Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book
How to get set up with Mediawiki running on Heroku.
Fork https://github.com/mediawiki/mediawiki (from the web interface)
(master
worked fine for me, but you might want the last stable tag?)
I've been looking for the best Linux backup system, and also reading lots of HN comments.
Instead of putting pros and cons of every backup system I'll just list some deal-breakers which would disqualify them.
Also I would like that you, the HN community, would add more deal breakers for these or other backup systems if you know some more and at the same time, if you have data to disprove some of the deal-breakers listed here (benchmarks, info about something being true for older releases but is fixed on newer releases), please share it so that I can edit this list accordingly.
- It has a lot of management overhead and that's a problem if you don't have time for a full time backup administrator.
After publishing my article on ECMAScript 6, some have reached out to ask how I exactly I make it all work.
I refrained from including these details on the original post because they're subject to immiment obsoletion. These tools are changing and evolving quickly, and some of these instructions are likely to become outdated in the coming months or even weeks.
When evaluating the available transpilers, I decided to use 6to5, which has recently been renamed to Babel. I chose it based on: