Skip to content

Instantly share code, notes, and snippets.

View gamecreature's full-sized avatar
🎢

Rick Blommers gamecreature

🎢
View GitHub Profile
@gamecreature
gamecreature / install_freebsd_bootloaders.sh
Last active January 23, 2025 10:50
Installs the FreeBSD Bootloader on all efi an freebsd-boot partitions. When installing the freebsd-boot partition it also installs the MBR. Without --commit nothings happens, only the commands are shown.
#!/bin/sh
emit() {
if [ "$arg_commit" = "1" ]; then
#echo " | $@"
echo " | $@"
$@ ## << make this the main command or run with `eval $@`
else
echo " | $@"
(exit 0)

Ruby: The future of frozen string literals

What is a literal?

In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.

Some examples:

7 # integer literal
@joeldrapper
joeldrapper / fingerprinting.rb
Created January 10, 2024 14:30
Rails request fingerprinting concern
# frozen_string_literal: true
module Fingerprinting
def full_fingerprint
generate_fingerprint(
ip_fingerprint,
browser_fingerprint
)
end
@georgekettle
georgekettle / PhlexMailerLayout.rb
Last active March 3, 2025 08:47
Phlex Mailer layout
You'll need to update the following variables:
- ENV['APP_NAME']
- ENV['COMPANY_ADDRESS']
- ENV['HOST']
Make sure you have app/assets/images/logo.svg for this line:
helpers.image_url('logo.svg')
And also update the CSS variables to match your color scheme:
:root {
@brotherkaif
brotherkaif / settings.json
Created September 12, 2023 17:19
LazyVim keymappings for VSCode
{
"vim.showMarksInGutter": false,
"vim.foldfix": true,
"vim.surround": true,
"vim.easymotion": true,
"vim.easymotionKeys": "asdghklqwertyuiopzxcvbnmfj",
"vim.leader": "<space>",
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": [":", "w", "<CR>"],
@skozz
skozz / TZInfo
Created February 22, 2019 14:28
[Solution Rails + Docker] TZInfo::DataSourceNotFound: tzinfo-data is not present. Please add gem 'tzinfo-data' to your Gemfile and run bundle install
- Add `gem 'tzinfo-data'` to the Gemfile.
- Add `tzdata` to the Dockerfile
```
RUN apk update \
&& apk add build-base \
tzdata
```
- Build `docker-compose build` or `docker-compose up --build`
- Enjoy the life
@dlangille
dlangille / 1 - I plan to turn these off
Last active March 21, 2024 13:25
Periodic things to turn off in FreeBSD jails
# after reviewing /etc/defaults/periodic.conf I have decided
# to disable these items in jails
daily_status_disks_enable="NO"
daily_status_network_enable="NO"
daily_status_uptime_enable="NO"
# not needed on jails
daily_ntpd_leapfile_enable="NO"
@amanjuman
amanjuman / Sendy Nginx Config
Last active November 8, 2024 14:28
Sendy Nginx Config for PHP8.1 FPM
sudo su
//Setup Hostname
hostnamectl set-hostname subdomain.domain.tld
## Basic
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get autoremove -y && sudo apt-get install software-properties-common
//Setup SWAP
sudo fallocate -l 1G /swapfile;
ls -lh /swapfile;
@migliori
migliori / fontawesome-icons-with-categories.json
Last active April 24, 2024 06:52
Font Awesome Version 5.0.6 JSON List with categories for use with https://codeb.it/fonticonpicker/ #webfonts
{
"Accessibility": [
"fab fa-accessible-icon",
"fas fa-american-sign-language-interpreting",
"fas fa-assistive-listening-systems",
"fas fa-audio-description",
"fas fa-blind",
"fas fa-braille",
"fas fa-closed-captioning",
"far fa-closed-captioning",
@mjackson
mjackson / multiple-git-hooks.sh
Created February 6, 2018 00:58
Run multiple scripts for the same git hook
#!/bin/sh
# This script should be saved in a git repo as a hook file, e.g. .git/hooks/pre-receive.
# It looks for scripts in the .git/hooks/pre-receive.d directory and executes them in order,
# passing along stdin. If any script exits with a non-zero status, this script exits.
script_dir=$(dirname $0)
hook_name=$(basename $0)
hook_dir="$script_dir/$hook_name.d"