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
# File: /etc/apt/apt.conf.d/docker-autoremove-suggests | |
# Since Docker users are looking for the smallest possible final images, the | |
# following emerges as a very common pattern: | |
# RUN apt-get update \ | |
# && apt-get install -y <packages> \ | |
# && <do some compilation work> \ | |
# && apt-get purge -y --auto-remove <packages> | |
# By default, APT will actually _keep_ packages installed via Recommends or |
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
#### Move queue data between machines #### | |
# Extract data as .yml file | |
rs = Sidekiq::RetrySet.new | |
report_yml = rs.to_a.to_yaml; | |
File.open('sidekiq_retries.yml', 'w') { |f| f.write(report_yml) } | |
# Read the data back | |
report_yml = File.open("sidekiq_retries.yml rb").read; | |
rs = YAML::load(report_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
VALID_IMAGE_SIGNATURES = [ | |
"\x89PNG\r\n\x1A\n".force_encoding(Encoding::ASCII_8BIT), # PNG | |
"GIF87a".force_encoding(Encoding::ASCII_8BIT), # GIF87 | |
"GIF89a".force_encoding(Encoding::ASCII_8BIT), # GIF89 | |
"\xFF\xD8".force_encoding(Encoding::ASCII_8BIT) # JPEG | |
].freeze | |
def file_is_image(temporary_file_path) | |
return false unless temporary_file_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
RESULT_CODES = (<<-EOT).split(/\r?\n/).reject {|s| s.match(/^( *#.*)?$/)}.map { |s| s.sub(/^ +/,'').split(/ +/,2) }.to_h | |
# Copied from http://dwalins.com/2014/codigo-de-respuesta-de-sermepa-redsys/ | |
0101 Tarjeta Caducada | |
0102 Tarjeta en excepción transitoria o bajo sospecha de fraude | |
0104 Operación no permitida para esa tarjeta o terminal | |
0106 Intentos de PIN excedidos | |
0116 Disponible Insuficiente | |
0118 Tarjeta no Registrada | |
0125 Tarjeta no efectiva | |
0129 Código de seguridad (CVV2/CVC2) incorrecto |
UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!
- liblinear-ruby: Ruby interface to LIBLINEAR using SWIG
This list is based on aliases_spec.rb.
You can see also Module: RSpec::Matchers API.
matcher | aliased to | description |
---|---|---|
a_truthy_value | be_truthy | a truthy value |
a_falsey_value | be_falsey | a falsey value |
be_falsy | be_falsey | be falsy |
a_falsy_value | be_falsey | a falsy value |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
LD_PRELOAD=/usr/local/Cellar/jemalloc/3.6.0/lib/libjemalloc.dylib unicorn -c config/unicorn.rb -E production -p 3000
-
http://samsaffron.com/archive/2014/04/08/ruby-2-1-garbage-collection-ready-for-production
LD_PRELOAD=/home/sam/Source/jemalloc-3.5.0/lib/libjemalloc.so RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=0.9 ruby stress.rb
NewerOlder