To adjust brush size
Hold down ⌃⌥ and drag the mouse left (smaller) or right (larger).
Or use the [ key (smaller) and ] key (larger).
To adjust brush hardness
| %w{ a b c d e f }.split("c", "e") | |
| # => [["a", "b"], ["c", "d"], ["e", "f"]] |
| /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user |
| # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] | |
| /Users/your-username/path-your-rails-project/log/*.log your-username:staff 644 4 * $D0 GJ | |
| # NOTES | |
| # | |
| # Place file in /etc/newsyslog.d | |
| # '$D0' under 'when' tells newsyslog to rotate logs daily at midnight. | |
| # Alternatively you could use '24' for 'when', which would specify "every 24 hours" | |
| # '*' under 'size' specifies that logs should be rotated regardless of their size. | |
| # 'G' under 'flags' tells newsyslog that the 'logfilename' is a pattern and it should rotate all log files matching the pattern. |
I hereby claim:
To claim this, I am signing this object:
| module FlexStruct | |
| def initialize(*args, **options) | |
| super(*args, *options.values_at(*members[args.length..-1])) | |
| end | |
| def self.new(*args, &block) | |
| Struct.new(*args, &block).include self | |
| end | |
| end |
Solutions to the Calculating with Functions CodeWars kata.
| #!/usr/bin/env ruby | |
| # Converts the output from reek to GitHub-flavoured Markdown. | |
| # | |
| # Usage: | |
| # Basically pipe the output from reek through this script. | |
| # | |
| # reek --sort-by smelliness app lib | ruby reek-to-markdown.rb | |
| def scan_line(line, pattern) |
| def common_array_prefix(*arrays) | |
| arrays.reduce do |a, b| | |
| index = a.zip(b).index { |x, y| x != y } | |
| a[0...index] | |
| end | |
| end | |
| def common_string_prefix(*strings) | |
| common_array_prefix(*strings.map(&:chars)).join("") | |
| end |
| #!/usr/bin/env ruby | |
| # Usage: ruby rails-locales-conflicts.rb [<rails root>] | |
| require "pathname" | |
| require "yaml" | |
| class Translations | |
| def initialize | |
| @translations = Hash.new do |h, k| |