Skip to content

Instantly share code, notes, and snippets.

View andxyz's full-sized avatar
:octocat:
ship it

Andrew Stevens andxyz

:octocat:
ship it
View GitHub Profile
@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 January 8, 2024 14:30
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
@fasterthanlime
fasterthanlime / the-point-then.md
Created July 10, 2017 09:08
You don't even get Steam keys? Jeez, what's the point then?

I'm so glad you asked!

Buying on itch.io:

  • Supports creators - our default cut is 10%, but they can pick any.
  • Lets you play the games you buy, DRM-free, whether you want to use our desktop client or not.

Many platforms out there are fighting for the "best Steam key reseller" title, which often means "the cheapest", and some are famously known for not caring whether said keys were acquired legitimately or not.

(Keep in mind that key reselling is something Valve allows because having more players now means more revenue later. If/when it stops being economically viable for them, they'll have no reason to keep allowing that. Those platforms might have to rethink their model then.)

@rtomayko
rtomayko / ssh-persistent-control-master.md
Created June 7, 2017 19:43
10x SSH connection speedup w/ persistent control masters

SSH Persistent Control Master Config

Add to ~/.ssh/config:

Host *
  # Enable persistent connection multiplexing
  ControlMaster auto
  ControlPath ~/.ssh/-%r@%h:%p
 ControlPersist 600