Skip to content

Instantly share code, notes, and snippets.

View dentarg's full-sized avatar
🌦️
=:D><!

Patrik Ragnarsson dentarg

🌦️
=:D><!
View GitHub Profile
@chockenberry
chockenberry / tot.sh
Last active October 30, 2025 02:14
A shell script for Tot
#!/bin/sh
basename=`basename $0`
if [ -z "$*" ]; then
echo "usage: ${basename} <dot> [ -o | -r | <file> | - ]"
echo ""
echo "options:"
echo " -o open dot in window with keyboard focus"
echo " -r read contents of dot"
@spk
spk / deploy.yaml
Created January 7, 2020 10:36
Github Action Heroku Git Deploy
# https://github.com/marketplace/actions/checkout
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#issue-comment-event-issue_comment
# https://devcenter.heroku.com/changelog-items/775
# https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
# https://github.com/cirrus-actions/rebase#installation
# https://github.com/actions/heroku/issues/10
---
name: Deploy to HEROKU_APP_NAME
on:
...
##
# Until this commit is merged and released by rack
#
gem 'rack', git: 'https://github.com/rack/rack.git', ref: 'c859bbf7b53cb59df1837612a8c330dfb4147392'
...
require 'net/http'
require 'socket'
def with_unresponsive_dns
fake_dns_ip = "127.0.0.1"
th = Thread.new do
server = UDPSocket.new
server.bind(fake_dns_ip, 53)
server.recvfrom(16)
sleep
end
@jasonrudolph
jasonrudolph / heroku-ci-sample-timings-and-cost.md
Last active December 22, 2021 18:12
Sample timings and costs using various Heroku CI dyno types

Sample timings (in seconds)

Sample timings using Heroku CI for a small-ish Rails 6 app on various Heroku dyno types:

Dyno Type Run 1 Duration Run 2 Duration Run 3 Duration Average Duration
standard-1x 312 213 303 276
standard-2x 227 121 222 190
performance-m 162 164 175 167
performance-l 100 104 107 104
public class Loop {
public static void main(String[] args) {
while (true) { }
}
}
@tuannvm
tuannvm / 0.12.tf
Last active December 3, 2022 18:50
#terraform #hashicorp #cheatsheet #0.12
#### first class expresssion
variable "ami" {}
resource "aws_instance" "example" {
ami = var.ami
}
#### list & map
resource "aws_instance" "example" {
vpc_security_group_ids = var.security_group_id != "" ? [var.security_group_id] : []
}
@srmds
srmds / Installing wkhtmltopdf 0.12.6, 0.12.5, 0.12.4 - Ubuntu 22.06 , 18.04, 16.04 x64, 0.12.6 - MacOS Ventura 13.6.md
Last active July 3, 2025 02:16
Installing wkhtmltopdf 0.12.4, 0.12.5 0.12.6 - Ubuntu 22.04 - 0.12.6, 16.04 x64, 0.12.5 - Ubuntu 18.04 x64 - 0.12.5 - macOS Ventura -13.6
@BretFisher
BretFisher / docker-for-mac.md
Last active November 9, 2025 22:48
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


$port = 15672;
[int]$attempt=0
$maxAttempts = 5
while(!$client.Connected -and $attempt -lt $maxAttempts) {
try {
$client = New-Object System.Net.Sockets.TcpClient([System.Net.Sockets.AddressFamily]::InterNetwork)
$attempt++; $client.Connect("127.0.0.1", $port); write-host "service is listening on port $port"
}
catch {
try {