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 | |
# vi: ft=sh | |
# | |
# © 2019 Konstantin Gredeskoul, Inc., All rights reserved. | |
# MIT LICENSE | |
# | |
# ———————————————————————————————————————————————————————————————— | |
# This script verifies that the current ruby (in PATH) is linked | |
# with libjemalloc library for efficient memory utilization. | |
# It works identically on Linux and Mac OSX. |
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
=begin | |
This script attempts to reproduce poor glibc allocator behavior within Ruby, leading | |
to extreme memory fragmentation and process RSS bloat. | |
glibc allocates memory using per-thread "arenas". These blocks can easily fragment when | |
some objects are free'd and others are long-lived. | |
Our script runs multiple threads, all allocating randomly sized "large" Strings between 4,000 | |
and 40,000 bytes in size. This simulates Rails views with ERB creating large chunks of HTML | |
to output to the browser. Some of these strings are kept around and some are discarded. |
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 'net/http' | |
module Net | |
class HTTP | |
def self.enable_debug! | |
raise "You don't want to do this in anything but development mode!" unless Rails.env == 'development' | |
class << self | |
alias_method :__new__, :new | |
def new(*args, &blk) | |
instance = __new__(*args, &blk) | |
instance.set_debug_output($stderr) |
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 | |
#Build and install neovim for Debian | |
#See: https://neovim.io/ | |
#See: https://github.com/neovim/neovim/wiki/Building-Neovim#quick-start | |
#See: https://gist.github.com/darcyparker/153124662b05c679c417 | |
#Save current dir | |
pushd . > /dev/null || exit |
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 'net/http' | |
require 'net/http/persistent' # gem install net-http-persistent | |
require 'benchmark' | |
class HttpNoTcpDelay < Net::HTTP | |
def on_connect | |
@socket.io.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) | |
nil |
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 | |
# print usage | |
DOMAIN=$1 | |
if [ -z "$1" ]; then | |
echo "USAGE: $0 tld" | |
echo "" | |
echo "This will generate a non-secure self-signed wildcard certificate for " | |
echo "a given development tld." | |
echo "This should only be used in a development environment." |
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 |