Skip to content

Instantly share code, notes, and snippets.

@Beyarz
Beyarz / stimulus.html
Last active March 17, 2022 00:45
StimulusJS on CDN
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Stimulus</title>
<script type="module">
import {
Application,
@Beyarz
Beyarz / vsco.rb
Last active March 16, 2022 12:34
Download all the images from a user on https://vsco.co
# frozen_string_literal: true
# rubocop:disable Layout/LineLength
require 'net/https'
require 'ruby-cheerio'
require 'json'
require 'cgi'
require 'open-uri'
# Pick your target here
@Beyarz
Beyarz / run.md
Created March 12, 2022 19:33
Enable devtool on macOS native windows
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
defaults write -g WebKitDeveloperExtras -bool YES
@Beyarz
Beyarz / .rubocop.yml
Last active October 20, 2022 18:15
Rubocop style config
# gem "rubocop-rails"
# gem "rubocop-rails_config"
# gem "rubocop-performance"
require:
- rubocop-rails
- rubocop-performance
inherit_gem:
rubocop-rails_config:
@Beyarz
Beyarz / entrypoint.sh
Created March 2, 2022 20:24
Rails development in container
curl -sL https://deb.nodesource.com/setup_12.x | bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt update
apt install -y nodejs yarn
bundle
rails server -b 0.0.0.0
@Beyarz
Beyarz / .dockerignore
Last active March 1, 2022 22:00
Rails (production) in Dockerfile with Node & Yarn included
node_modules
@Beyarz
Beyarz / import.rb
Created January 23, 2022 21:02
Download your mastodon toots
# frozen_string_literal: true
require 'mastodon'
require 'nokogiri'
# account_id is the ID of the account you want to retrieve statuses from, it can be found at https://base_url/web/accounts/XXX
Client = Struct.new(:base_url, :access_token, :account_id, :config, :statuses) do
def auth
return Mastodon::REST::Client.new(base_url: base_url, bearer_token: access_token)
end
@Beyarz
Beyarz / brakeman.md
Last active July 11, 2022 13:51
Linter

Brakeman

docker run -v "$(pwd)":/code presidentbeef/brakeman --color

@Beyarz
Beyarz / .railsrc
Last active February 21, 2022 18:24
rails config file .railsrc
--skip-action-mailer
--skip-action-mailbox
--skip-jbuilder
--skip-system-test
--database=sqlite3
--css=bootstrap
# --skip-activerecord
# --skip-active-storage
@Beyarz
Beyarz / github-light.css
Created January 7, 2022 01:13
Adds a white navbar to Github
/* ==UserStyle==
@name Github light theme
@description A lighter Github
@exclude https://github.com/home
@match https://github.com/*
@match https://gist.github.com/*
==/UserStyle== */
.Header-link, .input-sm {
color: black