Skip to content

Instantly share code, notes, and snippets.

View midwire's full-sized avatar
🏠
Working from home

Chris Blackburn midwire

🏠
Working from home
View GitHub Profile
@midwire
midwire / flash_all.sh
Last active November 17, 2022 17:41 — forked from willwm/flash_all.sh
[Flash complete stock ROM for OnePlus 8T] fastboot: Flash All Partitions (OnePlus 8T)
fastboot flash product product.img
fastboot flash abl abl.img
fastboot flash aop aop.img
fastboot flash bluetooth bluetooth.img
fastboot flash boot boot.img
fastboot flash cmnlib cmnlib.img
fastboot flash cmnlib64 cmnlib64.img
fastboot flash devcfg devcfg.img
fastboot flash dsp dsp.img
fastboot flash dtbo dtbo.img
# Using these pry gems -- copy to your Gemfile
# group :development, :test do
# gem 'awesome_print' # pretty print ruby objects
# gem 'pry' # Console with powerful introspection capabilities
# gem 'pry-byebug' # Integrates pry with byebug
# gem 'pry-doc' # Provide MRI Core documentation
# gem 'pry-rails' # Causes rails console to open pry. `DISABLE_PRY_RAILS=1 rails c` can still open with IRB
# gem 'pry-rescue' # Start a pry session whenever something goes wrong.
# gem 'pry-theme' # An easy way to customize Pry colors via theme files
# end
// ==UserScript==
// @name Twitter - Remove Promoted Tweets
// @description Remove promoted tweets from Twitter
// @author Nick Stakenburg
// @namespace https://gist.githubusercontent.com/staaky
// @license MIT; https://opensource.org/licenses/MIT
// @updateURL https://gist.githubusercontent.com/staaky/743103cc6e0e6a4bff6d2fca73e95d1e/raw/twitter-remove-promoted-tweets.user.js
// @downloadURL https://gist.githubusercontent.com/staaky/743103cc6e0e6a4bff6d2fca73e95d1e/raw/twitter-remove-promoted-tweets.user.js
// @include http://twitter.com/*
// @include https://twitter.com/*
@midwire
midwire / initdb-on-debian.sh
Last active January 9, 2021 23:56 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands #devops #postgres
# As postgres user
/usr/lib/postgresql/11/bin/initdb -D /var/lib/postgresql/11/main
# etc.
@midwire
midwire / git commands.md
Last active August 23, 2022 17:07 — forked from scootcho/git commands.md
[Common Git Commands] #git #shell

initialize git depository in the current directory

git init .

display the git remote/origin

cat .git/config
@midwire
midwire / rbenv-install-system-wide.sh
Created June 7, 2018 15:15 — forked from cblackburn-ajla/rbenv-install-system-wide.sh
CentOS: rbenv install and system wide install
#!/bin/bash
# CentOS rbenv system wide installation script
# Forked from https://gist.github.com/1237417
# Installs rbenv system wide on CentOS 5/6, also allows single user installs.
# Install pre-requirements
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \
make bzip2 autoconf automake libtool bison iconv-devel git-core
@midwire
midwire / git-merged-branches.rb
Created October 24, 2017 18:22 — forked from cblackburn-ajla/git-merged-branches.rb
Determine orphaned branches that have been merged into another branch.
#!/usr/bin/env ruby
#
# Get a list of merged branches
#
# You need to checkout the target remote branch before running. In other words,
# if your target branch is 'master', you have to have it checked out before you
# run this script, otherwise you will get an error like: `fatal: malformed
# object name master`. Git needs to have the branch checked out and pulled in
# order to find the branches that have/have-not been merged into it.
#
@midwire
midwire / database_state_loader.rb
Created July 6, 2017 16:47 — forked from keithpitt/database_state_loader.rb
Note that this code only works with PostgreSQL, but it wouldn’t be too hard to adapt our approach for other relational databases.
# Add to `spec/support/database_state_loader.rb`
class DatabaseStateLoader
class EnvironmentError < RuntimeError; end
def self.load(path)
new(path).load
end
def initialize(path)
@midwire
midwire / gist:bd9aceb83cac086ac90862d30f968a37
Created April 12, 2017 20:52 — forked from trcarden/gist:3295935
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@midwire
midwire / sierra-virtualbox-install.md
Created March 27, 2017 21:14 — forked from arobb/sierra-virtualbox-install.md
Install macOS Sierra in VirtualBox on macOS host

Step 1 (Creating a bootable macOS Sierra ISO for VirtualBox):

  1. hdiutil attach /Applications/Install\ macOS\ Sierra\ Public\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
  2. hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
  3. hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
  4. asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
  5. rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
  6. cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
  7. cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist