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 | |
# frozen_string_literal: true | |
def read_changes | |
gem_changes = {} | |
ARGF.each_line do |line| | |
next unless /(?<op>[-+]) (?<name>\S+) \((?<ver>\S+)\)/ =~ line.strip | |
gem_changes[name] ||= {} |
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 | |
# https://httpd.apache.org/docs/2.2/misc/password_encryptions.html | |
HTPASSWD=$1 | |
USERNAME=$2 | |
PASSWORD=$3 | |
ENTRY=`cat $HTPASSWD | grep "^$USERNAME:"` | |
HASH=`echo $ENTRY | cut -f 2 -d :` | |
SALT=`echo $HASH | cut -f 3 -d $` |
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
defmodule LinkParser do | |
@moduledoc """ | |
- https://tools.ietf.org/html/rfc8288 | |
- https://tools.ietf.org/html/rfc5988 | |
- https://www.iana.org/assignments/link-relations/link-relations.xhtml | |
""" | |
import NimbleParsec |
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
service_klass_to_property_keys = { | |
JiraService => %w[api_url url username password] | |
} | |
service_klass_to_property_keys.each do |klass, property_keys| | |
template_properties = klass.find_by!(template: true).properties.slice(*property_keys) | |
klass.find_each do |service| | |
service.properties = service.properties.merge(template_properties) | |
service.save! if service.changed? |
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 -eux | |
# tested with phoenix 1.3.0 | |
shopt -s nullglob | |
app_path=$1 | |
elixir_version=${ELIXIR_VERSION:-1.6.1} | |
echo n | mix phx.new "$app_path" --no-brunch --no-html | |
cd "$app_path" |
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
servername= | |
port= | |
echo \ | |
| openssl s_client -showcerts -servername $servername -connect $servername:$port 2>&1 \ | |
| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' \ | |
> $servername.crt |
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
[alias] | |
# basic shortcut | |
br = branch | |
ci = commit | |
co = checkout | |
df = diff | |
rb = rebase | |
stat = status | |
# full info |
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 'nokogiri' | |
require 'open-uri' | |
entries = [] | |
current_entry = nil | |
doc = Nokogiri::HTML(open('http://www.ohler.com/dev/oj_misc/release_notes.html')) | |
body = doc.at_css('.content_box') | |
body.children.each do |cur| |
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 | |
echo "# Update brew" | |
brew update && brew upgrade | |
brew doctor | |
brew cleanup | |
echo "# Update ruby gem" | |
gem update --system && gem update |
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/sh | |
HAROOPAD_BIN=/opt/homebrew-cask/Caskroom/haroopad/0.10.0/haroopad.app/Contents/MacOS/node-webkit | |
cd $(dirname "$1") | |
ABS_PATH="$(pwd)/$(basename "$1")" | |
exec $HAROOPAD_BIN $ABS_PATH &> /dev/null & |
NewerOlder