- 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
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
package main | |
import ( | |
"context" | |
"fmt" | |
"net/http" | |
"os" | |
"os/signal" | |
"syscall" | |
"time" |
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
''' This script uses ytmusicapi and pytube together to download your playlists, history or 'liked' songs as | |
high-quality audio-only streams from Youtube Music, which are protected by a "signatureCipher" obfuscation scheme. | |
To use it, first install [ytmusicapi] and [pytube] using pip, then follow the instructions for creating the auth | |
file from the response in an authenticated session to a watch-page request as found in your browser's dev-tools. | |
The downloaded files are placed in ~/Music, named with the artist and track metadata, and will be skipped instead | |
of downloaded again next time it is run, based on the videoIds of the downloaded songs. | |
Merry Xmas - V. |
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
{ | |
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json", | |
"basics": { | |
"name": "Stéphane BUSSO", | |
"label": "Tech Leader | Architect | Developer | Web3 | Blockchain | SaaS", | |
"image": "", | |
"email": "[email protected]", | |
"phone": "+642108923834", | |
"summary": "As an experienced engineering manager and technical leader, I enjoy helping companies grow their teams, design and develop better software solutions, be agile, and deliver quality products and services faster.", | |
"location": { |
I was building up a small library of css snippets, and mixing and matching via copy-paste was getting tiresome.
So, I knocked myself up a little solution using https://sass-lang.com/
To use this solution, you need to follow the instructions on the website to install the SASS command line utility.
For my purposes, I created a subfolder in my Obsidian vault called ./.themes
where my obsidian.scss
file lives.
I also created a subfolder for mixins (./.themes/mixins
) containing small snippets like "Andy Matuschak" mode and collapsing sidebars (and my preferred custom colours for my Base2Tone theme)
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
const apiUrl = "http://api.quotable.io/random?tags="; | |
async function start() { | |
var quote; | |
var cite; | |
const response = await fetch(apiUrl); | |
const data = await response.json(); | |
if (response.ok) { | |
// Update DOM elements |
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
# Install some required packages first | |
sudo apt update | |
sudo apt install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg2 \ | |
software-properties-common | |
# Get the Docker signing key for packages |
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
def hello(): | |
print "hello" |
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
#!/bin/bash | |
# create a slideshow from images, with nice blending | |
# using MLT or ffmpeg | |
# adapted from https://superuser.com/a/834035 | |
# | |
# beware of the ffmpeg command, it eats memory quickly | |
# USAGE | |
# 1 pass images as arguments |
A Pen by Jake Albaugh on CodePen.
NewerOlder