Skip to content

Instantly share code, notes, and snippets.

View pboling's full-sized avatar
🏓
Ping me if you need me!

|7eter l-|. l3oling pboling

🏓
Ping me if you need me!
View GitHub Profile
@pboling
pboling / Github Webhook Tutorial.md
Created July 29, 2025 19:12 — forked from jagrosh/Github Webhook Tutorial.md
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@pboling
pboling / asdf_install_ruby_3.0.7.sh
Created March 11, 2025 18:18
asdf install Ruby 3.0.7 on Mac Silicon
RUBY_APPLY_PATCHES=ruby-3-0-7-arm64.patch ASDF_RUBY_BUILD_VERSION=master asdf install ruby 3.0.7
@pboling
pboling / eslint.config.js
Created April 22, 2024 01:44
A working ESLint Flat Config for Svelte with TypeScript
import eslint from '@eslint/js';
import pluginImport from 'eslint-plugin-import';
import svelteEslint from 'eslint-plugin-svelte';
import globals from 'globals';
import svelteParser from 'svelte-eslint-parser';
import tsEslint from 'typescript-eslint';
// TODO: Turn on jsdoc
// import jsdoc from 'eslint-plugin-jsdoc';
import markdown from 'eslint-plugin-markdown';
@pboling
pboling / eslint.config.js
Created April 3, 2024 13:19
ESLint Flat Config for Svelte5 w/ Typescript
// Typescript is not entirely working yet...
// pnpm i -D globals
import globals from 'globals';
import jsESLint from '@eslint/js';
// import * as espree from "espree";
import tsESLint from 'typescript-eslint';
import tsESLintParser from '@typescript-eslint/parser';
// TODO: I wasn't able to get the parser for extra files working, but maybe we don't need it?
// import * as tsESLintExtraParser from 'typescript-eslint-parser-for-extra-files';
@pboling
pboling / rubygems_by_ruby.js
Created February 26, 2024 09:38
RubyGems versions for Ruby versions
// From: https://github.com/ruby/setup-ruby/pull/551/files#diff-344d865bd0fa41eafba66242f01ff940b063438e51ec83de8e4a613910ee9637R38-R55
if (engine === 'ruby') {
const rubyFloatVersion = common.floatVersion(version)
if (common.isHeadVersion(version)) {
console.log('Ruby master builds use included RubyGems')
} else if (rubyFloatVersion >= 3.0) {
await exec.exec(gem, ['update', '--system'])
} else if (rubyFloatVersion >= 2.6) {
await exec.exec(gem, ['update', '--system', '3.4.22'])
} else if (rubyFloatVersion >= 2.3) {
@pboling
pboling / db_reset.server.ts
Last active March 9, 2025 18:39
Squash PostgreSQL Migrations with drizzle-kit and pgtools
// Author: |7eter l-|. l3oling
// License: MIT
// Copyright: 2024
// See: https://gist.github.com/pboling/f831235a1f3c5627f0341c4bbcf37ea9
// Inspired by https://gist.github.com/RavenHursT/1dd87fb3460183b02ed1cf1dba065de8
/*
Usage:
1. Add pre-requisites:
@pboling
pboling / hash_delegate.rb
Created February 9, 2024 15:37 — forked from eric-hemasystems/hash_delegate.rb
Rails `delegate to:` for hashes
module HashDelegate
# Like `delegate :foo, to: :bar` only for hashes instead
# of objects. So these are the same:
#
# def foo
# bar[:foo]
# end
#
# hash_delegate :foo, to: :bar
@pboling
pboling / a_status_persistence.rb
Created September 3, 2023 23:30
Simple Status Persistence & Tracking for RSpec
# This will not run on CI, because we don't need to store a "last run" on CI.
# On local dev it will allow you to run:
# bundle exec rspec --only-failures
# Which will only run the tests that failed last time.
persistence_file_path = "test-reports/last_run_status.txt"
class SpecOut
attr_reader :run_tracker
@instance_mutex = Mutex.new
@pboling
pboling / gist:9601351c635a4fff62c9bbeb2fc146e6
Last active August 11, 2023 22:19
Ruby Random: Performance vs. Distribution
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'benchmark'
gem 'securerandom'
gem 'openssl'
gem 'ruby-statistics', require: 'statistics'
task :generate_engine do
# Get name sent from console
name = ENV['name'].downcase
# Store useful paths
engine_path = "engines/#{name}"
dummy_path = 'spec/dummy'
lib_files_path = 'lib/tasks/files'
dummy_relative_path = "#{engine_path}/#{dummy_path}"