connect to the boot2docker image via dinghy ssh
View rename-docker-volume.sh
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
docker volume create --name <new_volume> | |
docker run --rm -it -v <old_volume>:/from -v <new_volume>:/to alpine ash -c "cd /from ; cp -av . /to" | |
docker volume rm <old_volume> |
View README.md
View docker-run-mount-test.sh
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 bash | |
docker run -it -v $HOME/.ssh/id_rsa:/Users/docker/.ssh/id_rsa alpine sh -c "ls -lah /Users/docker/.ssh/" | |
# which should output something like: | |
# | |
# total 12K | |
# drwxr-xr-x 2 root root 4.0K Jan 21 19:19 . | |
# drwxr-xr-x 3 root root 4.0K Jan 21 19:19 .. | |
# -r-------- 1 10000000 10000000 1.7K Sep 27 2017 /Users/docker/.ssh/id_rsa |
View .bash_profile
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
docker-compose() { | |
if [ "$1" == "down" ]; then | |
echo "Running \`docker-compose stop\` first" | |
/usr/bin/env docker-compose stop | |
fi | |
/usr/bin/env docker-compose "$@" | |
} |
View docker-compose.yml
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
version: '2' | |
services: | |
jenkins: | |
image: 'bitnami/jenkins:2' | |
ports: | |
- '8080:8080' | |
- '8443:8443' | |
- '50000:50000' | |
volumes: | |
- 'jenkins_data:/bitnami' |
View attachment_upload_status.rb
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
# app/models/attachment_upload_status.rb | |
module AttachmentUploadStatus # no parent needed! | |
def self.cache_key(attachment) | |
"attachment_upload:#{attachment.global_id}:status" | |
end | |
def self.pending!(attachment) | |
Rails.cache.write(cache_key(attachment), 'pending', expires_in: 1.day.from_now) | |
end | |
View Gemfile
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
gem 'stackprof', require: false | |
gem 'ruby-prof', require: false |
View thread.rb
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 "yaml" | |
require "twitter" | |
config = YAML.load_file(File.expand_path("~/.trc")).dig("profiles", "qyliss").each_value.first | |
last_status = ARGV.fetch(0) | |
twitter = Twitter::REST::Client.new do |t| | |
t.consumer_key = config.fetch("consumer_key") | |
t.consumer_secret = config.fetch("consumer_secret") |
View ocr-shot.sh
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 | |
set -e | |
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/ "$1" stdout -l eng | xml esc) | |
hex=$((cat <<EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> |
View init.lua
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
-- ln -s ~/repos/config/init.lua ~/.hammerspoon/init.lua | |
-- Global variable for the Command Mode | |
cMode = hs.hotkey.modal.new({}, "F17") | |
-- Global variable for Delete Mode | |
dMode = hs.hotkey.modal.new({}, 'F20') | |
-- Global variable for Select Mode | |
sMode = hs.hotkey.modal.new({}, 'F19') |
NewerOlder