This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git hub command-line tool: brew install gh | |
git stuff - https://github.com/scmbreeze/scm_breeze | |
fuzzy finder (fzf): https://github.com/junegunn/fzf | |
rails groutes: https://gist.git.uscis.dhs.gov/spmarcia/1efd716f99bc8d441d0006cbe9f4fff0 | |
function ghpr() { | |
GH_FORCE_TTY=100% gh pr list | fzf --ansi --preview 'GH_FORCE_TTY=100% gh pr view {1}' --preview-window down | awk '{print $1}' | xargs gh pr checkout | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'fileutils' | |
require 'json' | |
require 'net/http' | |
require 'tmpdir' | |
class ChromedriverDownloader | |
def self.download | |
new.download |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Place in ~/bin | |
echo "Enter the ruby you want to install. E.g. 2.7.6" | |
read ruby_version | |
if [ -x "$(command -v rvm)" ]; then | |
if ! rvm install $ruby_version --with-gcc=clang; then | |
cd $HOME/.rvm/src/ruby-$ruby_version | |
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'jwt' | |
require 'jwe' | |
# Login.gov private key. | |
private_key = AppArtifacts.store.oidc_private_key | |
# Login.gov payload. | |
payload = { inherited_proofing_auth: 'mocked-auth-code-for-testing', exp: 1.day.from_now.to_i } | |
# Login.gov side: Send request... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Takes in_file that has lines in the format | |
# <username><:token><password> (e.g. user1:p@ssw0rd) | |
# and writes the passwords to out_file. | |
# | |
# Helpful for extracting the passwords from files | |
# found in /usr/share/seclists/Passwords/ | |
in_file = 'ssh-betterdefaultpasslist.txt' | |
out_file = '/tmp/passwords.txt' | |
token = ':' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Examples: | |
# | |
# Hacking::Networking.network_info_for(ip: '192.168.114.32/27') | |
# Hacking::Networking.network_info_for(ip: '192.168.33.12', mask: '255.255.224.0') | |
# => {:ip=>[192, 168, 33, 12], :mask=>[255, 255, 224, 0], :cidr_info=>{:cidr=>19, :network=>"192.168.32.0", :cidr_notation=>"192.168.32.0/19"}, :network=>"192.168.32.0", :host=>"0.0.1.12", :total_hosts=>8192} | |
# Hacking::Networking.network_for(ip: '192.168.33.12', mask: '255.255.224.0') # => "192.168.32.0" | |
# Hacking::Networking.host_for(ip: '192.168.33.12', mask: '255.255.224.0') # => "0.0.1.12" | |
# Hacking::Networking.total_hosts_for(mask: '255.255.224.0') # => 8192 | |
# Hacking::Networking.to_binary('192.168.33.12') # => "11000000.10101000.00100001.00001100" | |
# Hacking::Networking.to_binary('255.255.224.0') # => "11111111.11111111.11100000.00000000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for d in $( tmutil listlocalsnapshots / ) | |
do | |
if [[ $d =~ ^.+([0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6})$ ]]; then | |
date=${BASH_REMATCH[1]} | |
echo "Running tmutil deletelocalsnapshots $date..." | |
( tmutil deletelocalsnapshots $date ) | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script converts .heic files to .jpg files. The actual file encoding | |
# is checked, so that if the file is renamed correctly, it will be named | |
# and converted properly. | |
# | |
# Instructions: | |
# | |
# From the folder that contains the image files you want to convert... | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Call non-public methods directly to test | |
describe '#my_private_method' do | |
before do | |
Yardi::Yardi4LeaseTransfer.send(:public, *Yardi::Yardi4LeaseTransfer.private_instance_methods) | |
end | |
... | |
it 'should be able to call method directly' do | |
expect(object.my_private_method).to ... | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// This needs to go in the "~/.config.sublime-text-3/Packages" folder on Linux. | |
[ | |
{ | |
// Vertical scroll puck | |
"class": "puck_control", | |
"layer0.texture": "", | |
"layer0.opacity": 1.0, | |
"layer0.inner_margin": [0, 5], | |
"content_margin": [5, 20], | |
"blur": false, |
NewerOlder