Skip to content

Instantly share code, notes, and snippets.

View jclif's full-sized avatar
🏎️
Wheelin' and dealin'

Jared Clifton-Lee jclif

🏎️
Wheelin' and dealin'
View GitHub Profile
@mru2
mru2 / restore
Last active May 13, 2019 00:12 — forked from jgillman/restore.sh
pg_restore a local db dump into Docker
# Create and download backup
heroku pg:backups:capture
heroku pg:backups:download
# Assumes the database container is named 'db'
DOCKER_DB_NAME="$(docker-compose ps -q db)"
DB_HOSTNAME=db
DB_USER=postgres
LOCAL_DUMP_PATH="path/to/local.dump"

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@remarkablemark
remarkablemark / Dockerfile
Last active April 24, 2024 13:40
Install node and npm with nvm using Docker.
# set the base image to Debian
# https://hub.docker.com/_/debian/
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
@tomfuertes
tomfuertes / http2-server-push.rb
Last active February 2, 2019 19:32
Rails HTTP2 Server Push via Header Link (on Cloudflare)
class ApplicationController < ActionController::Base
after_action :server_push_headers # https://twitter.com/connorjshea/status/728472354385317888
def server_push_headers
# CLoudflare HTTP2 Server Push: https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2/
if request.format.html? # only on html pages
layout = self.send(:_layout) # with the right layout
if layout == "main" || layout == "speaker" || layout == "admin"
assets = [
@isochronous
isochronous / Application.root.js
Last active November 17, 2018 10:13
Root app for drop-in multi-app Marionette framework using requireJS and the subapprouter it works with
define([
"underscore",
"backbone",
"marionette",
"vent"
],
/**
* Creates the primary `Marionette.Application` object that runs the admin framework. Provides a central point
* from which all other sub-applications are started, shown, hidden, and stopped.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@jwieringa
jwieringa / vim-ruby-command-t-install.markdown
Created November 8, 2011 16:40
Install Vim with Ruby Interpreter and Command-T on Ubuntu

Summary

The following instructions will install Vim with the Ruby interpreter and Command-T. I keep my vim settings under revision control, thus I have chosen to use Git's submodules and Pathogen to manage Command-T. Depending on your preferences, you may want to setup Command-T differently. I recommend reading through the Command-T Readme

Install dependencies (what my system required), hg, and rake

sudo apt-get install ruby ruby-dev libncurses5-dev mercurial clone build-essential rake

I chose to compile vim with my system Ruby, 1.8.7. It is important that you use the same version to compile both Vim and Command-T. If your using RVM and you want to do the same, before proceeding you will want to:

rvm use system
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')