- Install stud
$ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
- Download and install the powssl script
$ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl
$ chmod +x ~/bin/powssl
- Run powssl to create development certificate and configure stud.
$ powssl
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
wc -l *.[ch] | grep -v total | sort -rn > /tmp/loc.txt | |
3696 cluster.c | |
3560 sentinel.c | |
3166 redis.c | |
2219 t_zset.c | |
1826 replication.c | |
1819 config.c | |
1633 redis-cli.c | |
1557 networking.c |
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
ruby_version="1.9.3-p392" | |
gem_version="1.8.25" | |
if [ ! -f /tmp/ruby/bin/ruby ]; then | |
cd /tmp | |
rm -f ruby-${ruby_version}.tar.gz | |
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-${ruby_version}.tar.gz | |
tar zxvf ruby-${ruby_version}.tar.gz | |
cd ruby-${ruby_version} | |
(./configure --prefix=/tmp/ruby && make -j4 && make install) || (echo "Ruby shat the bed" && exit 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
This tool is used to compare microbenchmarks across two versions of code. It's | |
paranoid about nulling out timing error, so the numbers should be meaningful. | |
It runs the benchmarks many times, scaling the iterations up if the benchmark | |
is extremely short, and it nulls out its own timing overhead while doing so. It | |
reports results graphically with a text interface in the terminal. | |
You first run it with --record, which generates a JSON dotfile with runtimes | |
for each of your benchmarks. Then you change the code and run again with | |
--compare, which re-runs and generates comparison plots between your recorded | |
and current times. In the example output, I did a --record on the master |
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
--- | |
- :cod_uf: '52' | |
:uf: Goiás | |
:city_id: '00050' | |
:city: Abadia de Goiás | |
:sigla_uf: GO | |
:city_code: '5200050' | |
- :cod_uf: '31' | |
:uf: Minas Gerais | |
:city_id: '00104' |
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
# | |
# freezing DateTime.now | |
# | |
# in Rails | |
$ rails c | |
Loading development environment (Rails 3.2.8) | |
# DateTime and Time have milliseconds before freezing time | |
>> DateTime.now.iso8601 9 |
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
<?php | |
/** | |
* Run with `wp --require=import-cache.php import ... | |
*/ | |
WP_CLI::add_hook( 'after_wp_load', function(){ | |
// Only intercept HTTP requests when the importer is running | |
if ( ! defined( 'WP_IMPORTING') || ! WP_IMPORTING ) { | |
return; |
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
# This file was generated by the `rails generate rspec:install` command. Conventionally, all | |
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. | |
# The generated `.rspec` file contains `--require spec_helper` which will cause this | |
# file to always be loaded, without a need to explicitly require it in any files. | |
# | |
# Given that it is always loaded, you are encouraged to keep this file as | |
# light-weight as possible. Requiring heavyweight dependencies from this file | |
# will add to the boot time of your test suite on EVERY test run, even for an | |
# individual file that may not need all of that loaded. Instead, make a | |
# separate helper file that requires this one and then use it only in the specs |
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 DrainStop do | |
@moduledoc """ | |
DrainStop Attempts to gracefully shutdown an endpoint when a normal shutdown | |
occurs. It first shuts down the acceptor, ensuring that no new requests can be | |
made. It then waits for all pending requests to complete. If the timeout | |
expires before this happens, it stops waiting, allowing the supervision tree | |
to continue its shutdown order. | |
DrainStop should be installed in your supervision tree *after* the | |
EndPoint it is going to drain stop. |
OlderNewer