Skip to content

Instantly share code, notes, and snippets.

View jaygooby's full-sized avatar
✏️
working on https://writiny.com in my sparse spare time

Jay Caines-Gooby jaygooby

✏️
working on https://writiny.com in my sparse spare time
View GitHub Profile
@jszmajda
jszmajda / 1readme.md
Last active September 3, 2022 18:33
Data Serialization: JSON, MsgPack, ProtoBufs
@trey
trey / hubot-slack-heroku.md
Last active October 25, 2021 03:18
Steps to Install Hubot in Slack using Heroku
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active May 20, 2025 13:11
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@chuckhoupt
chuckhoupt / archive_logs
Last active November 30, 2021 11:47
A shell script to archive web logs on DreamHost.
#!/bin/bash
# DreamHost Web Log Archiver
#
# DreamHost only stores web logs for a few days (configurable 3-30 days),
# so to maintain long term logs, an archive copy must be maintained.
#
# This script copies new gzipped http/https log files from logs/ to
# logs_archive/
#
@XVilka
XVilka / TrueColour.md
Last active April 27, 2025 10:17
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@zoul
zoul / build-notifier.rb
Last active May 17, 2018 15:21
Posts a message to the OS X notification center when a Jekyll build is finished. Requires TerminalNotifier, see http://git.io/5X99Eg or “gem install terminal-notifier”.
begin
require 'terminal-notifier'
module Jekyll
class Site
alias jekyll_process process
def process
jekyll_process
TerminalNotifier.notify('Jekyll rebuild finished.')
end
end
@tinabeans
tinabeans / template.html
Last active May 10, 2025 11:01
A super-barebones single-column responsive email template, assuming a max-width of 540px. Read about it on the Fog Creek blog.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Single-Column Responsive Email Template</title>
<style>
@media only screen and (min-device-width: 541px) {
.content {
@willurd
willurd / web-servers.md
Last active July 5, 2025 10:00
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jpetazzo
jpetazzo / README.md
Last active August 21, 2019 17:55
Give network superpowers to docker

Unionize: network superpowers for your docker containers

Unionize lets you connect together docker containers in arbitrarily complex scenarios.

Note: I recommend to use https://github.com/jpetazzo/pipework instead.

  • pipework is a better name than unionize
  • it's hosted on a "real" github repo instead of a small gist :-)

Now if you want Unionize, it's still here. Just check those examples.

@wangjohn
wangjohn / gist:5418350
Last active September 14, 2021 08:53
Rendering Partials in Rails

Let's look at what happens when you do something like this inside of a view:

<%= render partial: 'some_partial' -%>

To render a partial, Rails has a helper method inside of Action View. The render method serves as a delegator and takes its input arguments and provides them to the view_renderer object.

The view_renderer object is initialized when ActionView::Base is initialized and is of the ActionView::Renderer class. This class performs all of the rendering that is necessary inside of the views. The design pattern of delegating to an object is used. When you call view_renderer.render, you are asking the view_renderer object to delegate the arguments of your call to another more specific object.