Skip to content

Instantly share code, notes, and snippets.

View snuggs's full-sized avatar
👤
Committing

Snuggs snuggs

👤
Committing
View GitHub Profile

Prerequisites

To install Docker Engine, you need the 64-bit version of one of these Ubuntu versions:

  • Ubuntu Impish 21.10
  • Ubuntu Hirsute 21.04
  • Ubuntu Focal 20.04 (LTS)
  • Ubuntu Bionic 18.04 (LTS)

Install Docker Engine

@snuggs
snuggs / agreement.md
Last active December 26, 2024 16:55 — forked from nateberkopec/speedshop.md
Speedshop Contract

This is a Services Agreement between DEVPUNKS L.L.C. (“we,” “us,” “our”) and any individual, entity, or organization that procures our services (“you” or “your”).

  1. Acceptance of Terms: Any work that we do for you is governed by the terms and conditions that you’re reading now. If you don’t agree to them, we can’t provide you with any services. This agreement is a binding contract between you and DEVPUNKS L.L.C..
  2. Terms May Change: Periodically, we may change the terms and conditions in this agreement, including the amount of our fees. If we do change any of these terms, they’ll take effect for you the next time that you contract for our services. Any work that we’ve already completed or previously initiated for you continue to be governed by the agreement in effect at the time that you contracted with us.
  3. Taxes: You are responsible for payment of all applicable sales and use taxes.
  4. Refund: If you’re genuinely dissatisfied with our services and provide us with notice within thirty (30) days of deliv
@snuggs
snuggs / npi
Created December 26, 2024 16:46
NPM Install Loop _(For Slow Connections)_
#!/bin/env bash
set -e
# https://stackoverflow.com/a/74413191
while true; do
declare tail=$( ls ${HOME}/.npm/_logs/ | tail -n 1 )
declare log="${HOME}/.npm/_logs/${tail}"
echo "log: $log"
@snuggs
snuggs / .tmux.conf
Last active August 22, 2024 14:22
IDE & TMUX Configuration
############################################################################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
# Cheatsheets:
# https://devhints.io/tmux
# `property not found` issue:
@snuggs
snuggs / some_controller.rb
Created February 15, 2023 12:50 — forked from mlt/some_controller.rb
Stream PostgreSQL query with potentially huge result set as CSV using gzip compression in Rails and low memory overhead
headers['X-Accel-Buffering'] = 'no'
headers['Cache-Control'] = 'no-cache'
headers['Content-Type'] = 'text/csv; charset=utf-8'
headers['Content-Disposition'] = 'inline; filename="data.csv"'
headers['Content-Encoding'] = 'gzip'
sql = "select * from something;"
self.response_body = SqlToCsvStreamer.new(sql)
@snuggs
snuggs / .vimrc
Last active April 4, 2021 05:59
VIM "$ mkdir ~/.tmp # ensure directory exists first
set encoding=utf-8
" Author: Ahmid-Ra (github.com/snuggs)
" Screencasts: http://vimcasts.org
" Gist: https://gist.github.com/snuggs/612093
" Tutorial: http://learnvimscriptthehardway.stevelosh.com
@snuggs
snuggs / Gemfile
Last active November 18, 2020 22:48 — forked from calebwoods/Gemfile
Simple standalone ActiveRecord setup.
source 'https://rubygems.org'
gem 'activerecord', '>= 4.2.0'
gem 'sqlite4'
@snuggs
snuggs / DEMETER.rb
Last active November 18, 2020 22:47
Law of Demeter
def store(model)
# 99 of 100 times we will only need to call #to_h and be done with model
persist model.to_h # Breaks demeter's law
# this usually encourages poking around in the model
# which is no concern of store
end
def store(record) #decoupled
persist record #because that's all we want to do.
# If it doesn't work as expected RTST (Read The Stack Trace)
@snuggs
snuggs / tabs.before.html
Last active March 12, 2017 04:19
#devPunk Pure CSS Tabs
<!-- This doesn't work at all -->
<!-- Toggle -->
<div class="dropdown">
<a class="dropdown-inline-button" href="javascript: void(0);" data-toggle="tab"
data-target="#calibration">
<i class="dropdown-inline-button-icon icmn-database"></i>
Mostrar calibraciones
</a>
</div>
@snuggs
snuggs / metaprogramming_for_dummies.rb
Created March 24, 2011 21:31
Meta Programming Made Easy
# Yehuda Katz - (It's all about the self)
# http://yehudakatz.com/2009/11/15/metaprogramming-in-ruby-its-all-about-the-self/
#######################################################################################
# All classes are objects themselves
#######################################################################################
# Defining a class using the "class" keyword is merely syntactic sugar.
# All class definitions are actually instances of the Class object.