old pattern | new pattern | old example | new example |
---|---|---|---|
*_any | * | number_any | number |
*_cp | *_code_point | non_character_cp | noncharacter_code_point |
age_*_* | age=*.* | age_6_0 | age=6.0 |
ascii_hex | ascii_hex_digit | ascii_hex | ascii_hex_digit |
block_in* | in_* | block_inadlam | in_adlam |
ids_*_op | ids_*_operator | ids_binary_op | ids_binary_operator |
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
a = %w(⣾ ⣽ ⣻ ⢿ ⡿ ⣟ ⣯ ⣷) | |
loop { print a.rotate!.first; sleep 0.08; print "\b" } |
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 | |
FILES = %w[ | |
HPL003sh.pcx | |
HPL004sh.pcx | |
HPL006kn.pcx | |
hpl007sh.pcx | |
HPL102br.pcx | |
hpl112bs.pcx | |
HPS003sh.pcx |
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
export RUBY_VERSION=2.5.1; cd ~/.rbenv/plugins/ruby-build && git pull && cd $SEMAPHORE_PROJECT_DIR; rbenv install $RUBY_VERSION; rbenv local $RUBY_VERSION; gem install bundler --no-ri --no-rdoc |
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
<script> | |
if (window && window.navigator && /googlebot/i.test(window.navigator.userAgent)) { | |
var debug = function(key, value) { | |
var writeToBody = function() { document.body.setAttribute('data-' + key, value); }; | |
if (document.body) writeToBody(); | |
else window.addEventListener('DOMContentLoaded', writeToBody, false); | |
}; | |
debug('googlebot', '1'); |
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 'stringex' | |
require 'sexy_slug' | |
require 'benchmark' | |
string = (0..0xD799).map { |cp| cp.chr('utf-8') }.join | |
Benchmark.bmbm do |x| | |
x.report { string.to_url } | |
x.report { SexySlug.from(string) } | |
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
# subarray_combinations([['a', 'b'], [1, 2]]) | |
# # => [['a', 1], ['a', 2], ['b', 1], ['b', 2]] | |
def subarray_combinations(array_of_arrays, index = 0) | |
return [] if index == array_of_arrays.size | |
subarray = array_of_arrays[index] | |
tails = subarray_combinations(array_of_arrays, index + 1) | |
if tails.empty? |
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
# -*- warn-indent:false; -*- | |
# line 1 "~/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl" | |
# line 700 "~/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl" | |
# THIS IS A GENERATED FILE, DO NOT EDIT DIRECTLY | |
# This file was generated from lib/regexp_parser/scanner/scanner.rl |
foo
|
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 | |
# put in credentials dir, e.g. ~/.local/share/gem/swap_credentials | |
require 'fileutils' | |
active_path = "#{__dir__}/credentials" | |
memo_path = "#{__dir__}/memo" | |
current = File.exist?(memo_path) && File.read(memo_path) | |
Dir["#{__dir__}/credentials_*"].each do |cred_path| |
OlderNewer