Skip to content

Instantly share code, notes, and snippets.

Avatar
🖥️
Making computers do things!

Peter Vandenberk pvdb

🖥️
Making computers do things!
View GitHub Profile
View git-hub
#!/usr/bin/ruby
#
# frozen_string_literal: true
#
# INSTALLATION
#
# ln -s ${PWD}/git-hub $(brew --prefix)/bin/
#
# CONFIGURATION
View git-stash-switcher
#!/usr/bin/env ruby
#
# INSTALLATION
#
# ln -s ${PWD}/git-stash-switcher $(brew --prefix)/bin/
#
# COMING SOON!
View rbenv-upgrade
#!/usr/bin/env ruby -r semantic -r consenter
# frozen_string_literal: true
#
# INSTALLATION
#
# ln -s ${PWD}/rbenv-upgrade $(brew --prefix)/bin/
#
View subst
#!/usr/bin/env bash
#
# INSTALLATION
#
# ln -s ${PWD}/subst $(brew --prefix)/bin/
#
# ALTERNATIVE IMPLEMENTATION
#
# perl -p -i -e 's/${1?}/${2?}/g' file1.txt file2.txt ...
View git-ctags
#!/bin/sh
#
# INSTALLATION
#
# ln -s ${PWD}/git-ctags $(brew --prefix)/bin/
#
# https://tbaggery.com/2011/08/08/effortless-ctags-with-git.html
# https://github.com/tpope/vim-fugitive/commit/63a05a6#r35299123
View git-recurse
#!/usr/bin/env bash
#
# INSTALLATION
#
# ln -s ${PWD}/git-recurse $(brew --prefix)/bin/
#
find . -mindepth 2 -maxdepth 2 -type d -name .git | while read -r git_dir; do
git_path=$(dirname "${git_dir}");
View git-subst
#!/usr/bin/env bash
#
# INSTALLATION
#
# ln -s ${PWD}/git-subst $(brew --prefix)/bin/
#
FROM="$1" ;
TO="$2" ;
@pvdb
pvdb / consenter.rb
Last active Sep 4, 2018
idiomatic Enumerable extensions to filter elements by consent
View consenter.rb
# rubocop:disable all
# https://github.com/pvdb/consenter
require 'io/console'
class Consenter # :nodoc:
VALID_RESPONSES = {
'y' => 'yes to this',
@pvdb
pvdb / git-rev-diff
Last active Nov 3, 2021
Run the same command against two git revisions, and diff the output
View git-rev-diff
#!/usr/bin/env bash
#
# INSTALLATION
#
# ln -s ${PWD}/git-rev-diff $(brew --prefix)/bin/
#
# check command-line options
@pvdb
pvdb / SSLPoke.java
Created May 18, 2016 — forked from 4ndrej/SSLPoke.java
Test of java SSL / keystore / cert setup. Check the commet #1 for howto.
View SSLPoke.java
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {