Skip to content

Instantly share code, notes, and snippets.

Avatar

anon987654321

View GitHub Profile
View log.md

/packs/js/application-36cf54f041d91fc1eed7.js

(self["webpackChunkwebpackerrrrr"] = self["webpackChunkwebpackerrrrr"] || []).push([["application"],{

/***/ "./app/packs/channels sync recursive _channel\\.js$":
/*!************************************************!*\
  !*** ./app/packs/channels/ sync _channel\.js$ ***!
  \************************************************/
/***/ (function(module) {
View slack.md

relayd.conf

# OpenBSD/amd64 myserver.com

localhost="lo0"
public="vio0"

table <acme_challenge_table> { $localhost }
acme_challenge_port="5000"
View genders.md

Simple genders setup with enumeration

Inspired by this StackOverflow answer.

Processing by Devise::RegistrationsController#create as HTML
  Parameters: {
    "authenticity_token"=>"ART3MggfhahijyWwwp8VOLJO5d5/rUKk8SC3dHYepCnrNFM4a7QD56aIDThwNwdaFaN97cUrodeCvbUqTIeZFA==",
      "user"=>{
        "email"=>"admin@example.com",
 "password"=&gt;"[FILTERED]",
View solidus_install.md

Installing Solidus 2.10 on a fresh Rails app

  • Rails 6.0.3.3
  • Ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-openbsd]
  • sqlite3 3.29.0 2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6
dev@dev:~/mystore% rails generate spree:install
Running via Spring preloader in process 53310
 create config/initializers/spree.rb
View gist:8f5fea3ea3a22ab9eaa76c0b61cff483
Script started on Mon Sep 14 23:09:12 2020
dev@dev:~/mystore% rails generate spree:install
[Spree WARNING] Missing migrations.
[Spree WARNING] add_amount_remaining_to_store_credit_events from spree is missing.
[Spree WARNING] add_available_locales_to_stores from spree is missing.
[Spree WARNING] add_available_to_columns_and_remove_display_on_from_payment_methods from spree is missing.
[Spree WARNING] add_available_to_users_and_remove_display_on_from_shipping_methods from spree is missing.
[Spree WARNING] add_index_to_spree_payments_number from spree is missing.
[Spree WARNING] add_join_characters_to_promotion_code_batch from spree is missing.
[Spree WARNING] add_lft_and_rgt_indexes_to_taxons from spree is missing.
View replace.sh
#!/usr/bin/env zsh
#
# REPLACES STRINGS IN TEXT-BASED FILES
#
# replace <old string> <new string>
#
setopt extendedglob
# Dependency check
View csp.md

Custom CSPs for different hosts

http protocol "https_reverse_proxy" {
  [...]

  # CSPs to help reduce the risk of Cross-Site Scripting
  # https://content-security-policy.com/

  # Hosts that require custom CSPs
 match request header "Host" value "myapp1.com" tag "myapp1"
View backup.sh
#!/usr/bin/env zsh
#
# 11038420120702 BACKS UP IMPORTANT FOLDERS
#
# Requires: md5deep64
#
# backup [-t]
#
# -t Simulate backup
View gist:99becb9e75d235ce10b3490317eaff9e

/etc/rc.d/coolest_app_ever

Commandline works fine:

# doas -u apps sh -c 'cd /home/apps/coolest_app_ever ; /home/apps/.gem/bin/bundle exec
    /home/apps/.gem/bin/pumactl --config-file /home/apps/coolest_app_ever/config/puma.rb start'
Puma starting in single mode...
* Version 4.3.3 (ruby 2.6.6-p146), codename: Mysterious Traveller
* Min threads: 0, max threads: 16
* Environment: production