Skip to content

Instantly share code, notes, and snippets.

View dangra's full-sized avatar
🦖

Daniel Graña dangra

🦖
View GitHub Profile
@mitchellh
mitchellh / merge_vs_rebase_vs_squash.md
Last active May 10, 2024 19:51
Merge vs. Rebase vs. Squash

I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.

I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:

Autofill OpenVPN OTP

On MacOS with Tunnelblick.

brew install oath-toolkit
mkdir ~/Documents/my-vpn.tblk
cp ~/Downloads/profile.ovpn ~/Documents/my-vpn.tblk/
printf "#!/bin/bash\n/usr/local/bin/oathtool --totp -b -d 6 {OTP_KEY_HERE}" > ~/Documents/my-vpn.tblk/static-challenge-response.user.sh
chmod +x ~/Documents/my-vpn.tblk/static-challenge-response.user.sh
@mpasternacki
mpasternacki / docker-compile.pl
Last active March 23, 2020 14:05
Perl script to build a Docker image from Dockerfile that creates the image in a single layer, without any intermediate images. Needs JSON CPAN module (available as `libjson-perl` Debian/Ubuntu package). Usage: run the script in the directory that contains a Dockerfile. More details in a blog post: http://3ofcoins.net/2013/09/22/flat-docker-images/
#!/usr/bin/env perl
use feature 'switch';
use strict;
use warnings;
use Data::Dumper;
use File::Basename;
use File::Copy;
use File::Path qw/make_path/;
@dangra
dangra / formtest.py
Created April 15, 2012 04:14
Scrapy FormRequest benchs
from scrapy.http.response.text import TextResponse
# import form
import lxmlform
import lxmlform_noxmlns
l = ['<html><body><form><select name="hugeselect">']
for i in range(1000):
l.append('<option value="%s">%s</option>' %(i,i))
l.append('<option selected="selected" value="selected">selected</option>')