One of Ruby's major influences was Perl, leaving well equipped to replace bash, sed, and awk. Lets take a look at how to do that.
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
Hi S-------. I'm not an expert in performance benchmarking--I focus on | |
correctness and safety--but I have a few pieces of advice here. | |
0. Pick multiple workloads that cover the gamut of behaviors in each DB. | |
*Don't* choose a completely sharded workload for VoltDB. Don't choose a | |
purely commutative workload for Cassandra. Cassandra's Paxos | |
implementation is slow and a good benchmark will demonstrate | |
that--however, it *doesn't* (I think?) require a global coordinator, | |
which means it might *scale* better than a single-coordinator system | |
like, say, VoltDB. Talk about those differences! |
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
#!/bin/sh | |
# Reboot netgear CM400 cablemodem via curl | |
curl -s -u admin:password 'http://192.168.100.1'$(curl -s -u admin:password http://192.168.100.1/RouterStatus.htm | grep id=[0-9] | cut -d'"' -f2) --data 'buttonSelect=2&wantype=dhcp&enable_apmode=0' > /dev/null |
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
# video @ https://vimeo.com/217144282 | |
require 'graphics' | |
class Walkers < Graphics::Simulation | |
def initialize | |
super 800, 600, 24 | |
color.default_proc = -> h, k { k } | |
@walkers = 50.times.map do | |
length = 15 | |
colour = [ |
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
# LVDB - LLOOGG Memory DB | |
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]> | |
# All Rights Reserved | |
# TODO | |
# - cron with cleanup of timedout clients, automatic dump | |
# - the dump should use array startsearch to write it line by line | |
# and may just use gets to read element by element and load the whole state. | |
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands. | |
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump! |
If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8
To use the new phx.new
project generator, you can install the archive with the following command:
$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez
Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs
:
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
node_modules |
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 MyApp.Scheduler do | |
@moduledoc """ | |
Schedules a Mix task to be run at a given interval in milliseconds. | |
## Options | |
- `:task`: The name of the Mix task to run. | |
- `:args`: A list of arguments to pass to the Mix task's `run/1` function. | |
- `:interval`: The time interval in millisconds to rerun the task. |
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
#!/bin/bash | |
set -e | |
droplet=netflix | |
interface=Wi-Fi | |
us_regions=( nyc1 nyc2 nyc3 ) | |
random_region() { | |
echo ${us_regions[RANDOM % ${#us_regions[@]}]} | |
} |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
NewerOlder