Skip to content

Instantly share code, notes, and snippets.

@akrabat
akrabat / no_automount
Created August 5, 2020 08:51
Add a volume to /etc/fstab to prevent auto-mounting. See http://akrabat.com/prevent-an-external-drive-from-auto-mounting-on-macos/
#!/usr/bin/env bash
# Usage: ./no_automount My\ Disk
NAME=$1
if [ -z "$NAME" ] ; then
echo "Usage: no_automount {Disk Name}"
exit 1
fi
FSTAB=/etc/fstab
@6
6 / readme.md
Last active May 28, 2018 07:45
Batch-update Heroku dataclip databases using js console

If you have many dataclips pointing to a database, and upgrade that database to a different plan, those dataclips will continue pointing to the old database. This will show you how to update all of those dataclips to point to the new database.

Step 1. Log in to Heroku

Step 2. Find heroku_resource_id for each databases

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 6, 2024 02:17
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@tadas-s
tadas-s / irbify.rb
Created September 12, 2013 13:46
Running local ruby scripts on remote Heroku app instance
#!/usr/bin/env ruby
#
# Usage:
# irbify.rb script.rb | heroku run rails console --app=my-app
#
# Why eval and not piping directly? Piping directly would run all lines even if previous line was an invalid statement.
#
script_name = ARGV[0]
#!/usr/bin/env ruby
#
# git fuzzy-checkout
# Same as `git checkout branch`, but with fuzzy matching if checkout fails.
# Turns `git checkout barnch` into `git checkout branch`,
# assuming `branch` is a branch.
# to use, you can alias:
# alias co="git fuzzy-checkout"
# co msater
@rhblind
rhblind / pg_killcon.sh
Last active September 29, 2021 03:20
Bash script to kill active connections on a PostgreSQL database
#!/bin/bash
#
# A simple script to kill all connections to
# a postgresql database.
#
function usage() {
cat << EOF
usage: $0 options
@johnantoni
johnantoni / mysql.txt
Created August 7, 2012 18:57
mysql + vagrant + remote access
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
@x-Code-x
x-Code-x / readme_install_node
Created April 30, 2012 20:52
Install npm node.js on Debian Squeeze / Wheezy / Linux Mint Debian Edition
#Quick cp from http://sekati.com/etc/install-nodejs-on-debian-squeeze
#
#Needed to install TileMill from MapBox
#
#Installs node.js which has npm bundled
#
#Build Dependencies
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev
@austenito
austenito / integration_spec.rb
Created April 11, 2012 12:50
Integration Testing w/ Sorcery
describe "Shopping Cart Requests" do
let!(:user) { Fabricate(:user) }
before(:each) do
login_user_post("admin", "admin")
end
context "when I visit the shopping cart" do
it " show the logged in users' cart items " do
#Test stuff
@steveclarke
steveclarke / capybara.md
Created April 10, 2012 17:32
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)