Skip to content

Instantly share code, notes, and snippets.

View andxyz's full-sized avatar
:octocat:

Andrew Stevens andxyz

:octocat:
View GitHub Profile
local wezterm = require "wezterm"
local config = wezterm.config_builder()
local action = wezterm.action
config.set_environment_variables = {
PATH = '/opt/homebrew/bin:' .. os.getenv('PATH')
}
local function scheme_for_appearance(appearance)
if appearance:find "Dark" then
@Vigrond
Vigrond / jellyfinchromecast.md
Last active October 8, 2025 14:40
Jellyfin with Chromecast
@kddnewton
kddnewton / latexify.rb
Last active November 7, 2022 14:45
LaTeXify Ruby methods
#!/usr/bin/env ruby
# frozen_string_literal: true
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "syntax_tree"
end
@kddnewton
kddnewton / gems.rb
Last active March 15, 2023 17:02
Extract the latest versions of each Ruby gem on your system
# frozen_string_literal: true
require "rubygems/package"
require "net/http"
require "tmpdir"
queue = Queue.new
Gem::SpecFetcher.new.available_specs(:latest).first.each do |source, gems|
gems.each do |tuple|
gem_name = File.basename(tuple.spec_name, ".gemspec")
@davidwessman
davidwessman / update-next.yml
Last active July 29, 2022 15:15
Action to upgrade Gemfile.next.lock
name: Update next
on:
pull_request:
paths:
- "Gemfile.lock"
jobs:
update:
runs-on: ubuntu-20.04
@berkedel
berkedel / flow-error-icu4c-not-loaded.md
Created April 4, 2018 14:13
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

How to solve dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

brew uninstall --ignore-dependencies node icu4c
brew install node
@gnthibault
gnthibault / gist:5366255d455c763ebbd790ca32564ee4
Created February 15, 2018 10:15 — forked from wikimatze/gist:9790374
Github Two-Factor Authentication Failed For HTTPS

I heard from GitHub Two-Factor Authentication](https://github.com/blog/1614-two-factor-authentication) nearly a couple of days ago when I was reading my RSS feed. I enabled it and couldn' push to any of my repositories anymore. Learn in this blog post how to fix it.

Two-Factor Authentication

"Is a process involving two stages to verify the identity of an entity trying to access services in a computer or in a network". Github solves this authentication with sending an SMS to a device which wants to push to their platform.

Enabling Two-Factor Authentication

@tdonohue
tdonohue / ConsoleZ-PowerShell-Git-for-Windows.md
Last active November 19, 2022 03:36
ConsoleZ + PowerShell + Posh-Git + Git for Windows (with SSH Agent Forwarding!)

Integrating ConsoleZ + Powershell + Git for Windows + posh-git (with SSH agent forwarding + Vagrant)

Tested on: Windows 10


This setup includes the following:

  • Using ConsoleZ for your terminal (This is optional. If you don't want it, skip anything having to do with ConsoleZ and just use PowerShell)
  • Running PowerShell behind the scenes
  • Installing Git for Windows + posh-git, to provide git commands (and ssh) to PowerShell
  • Auto-starting posh-git's SSH-Agent for SSH forwarding to remote servers, VMs, Vagrant, etc.
@kaspth
kaspth / after_runnable.rb
Created September 14, 2017 16:49
`Minitest.after_runnable` callbacks to execute after every test class method has been run… it might even work!
# minitest uses Gem.find_files, so this should be somewhere on the load path:
# $LOAD_PATH/minitest/after_runnable_plugin.rb
class Minitest
class AfterRunnableReporter < AbstractReporter
def initialize(after_runnable, methods)
@after_runnable, @methods = after_runnable, methods
end
def prerecord(klass, name)
@methods[klass].delete(name)
@matsukaz
matsukaz / application.rb
Last active May 13, 2025 06:14
Rails connection management to handle Amazon Aurora's failover
module xxx
class Application < Rails::Application
#(中略)
config.middleware.swap ActiveRecord::ConnectionAdapters::ConnectionManagement,
'ActiveRecord::ConnectionAdapters::ReconnectOnErrorManagement'
end
end