List moved
Please use https://github.com/bf4/learning to fork and pull changes.
@states = { | |
AL: "Alabama", | |
AK: "Alaska", | |
AZ: "Arizona", | |
AR: "Arkansas", | |
CA: "California", | |
CO: "Colorado", | |
CT: "Connecticut", | |
DE: "Delaware", | |
FL: "Florida", |
~ #node.js | |
[20.16.16] < TheEmpath> so | |
[20.16.34] < TheEmpath> anyone else have a hot programmer girl in their office? o____O | |
[20.16.42] < Lorentz> I wiiish | |
[20.16.48] <@Nexxy> not appropriate. | |
[20.16.57] »¡« Signoff caaakeeey: #Node.js (Ping timeout: 260 seconds) | |
[20.17.32] < joshwnj> yeah guys, grow up | |
[20.17.38] < jerrysv> Nexxy: olynode was fun, you should have gone | |
[20.18.03] < TheEmpath> my boss came by and said "Here, a new subodinate" and its a very attractive female. the otherwise painfully quite engineering room suddenly came to life and its a problem :X | |
~~~~~~~ |
require 'benchmark/ips' | |
require 'allocation_stats' | |
def access_slashed_string | |
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis molestie " \ | |
"elementum urna, a accumsan nunc euismod et. Aliquam porttitor, leo in " \ | |
"aliquet aliquam, magna quam venenatis nulla, vel sagittis nisi nisi et " \ | |
"nulla. Nulla quis facilisis turpis, vel blandit risus. Maecenas ut ante " \ | |
"quis velit pretium pharetra ac rhoncus massa. Nulla quam dui, placerat " \ | |
"eget quam vel, ultricies eleifend sem." |
[david: compare]$ # at this point we have a stock rails app with no minitest tests and one pending rspec example | |
[david: compare]$ | |
[david: compare]$ time rake test | |
Run options: | |
# Running tests: | |
Finished tests in 0.030419s, 0.0000 tests/s, 0.0000 assertions/s. |
List moved
Please use https://github.com/bf4/learning to fork and pull changes.
The `decode` function has been re-adapted from code provided by Moodstocks SAS and | |
therefore the following license applies to it: | |
Copyright (C) 2014 by Moodstocks SAS | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
Deploying a Phoenix app to Fly.io is a breeze...is what everyone kept telling me. In fairness, I imagine the process would have been breezier had I just used postgres, but all the sqlite and litestream talk has been far too intriguing to ignore. "Wait", you say. "It is just a flat file. How much harder can it be?"
It is easy to make something harder than it should be. It is hard to take something complex and make it truly simple. flyctl launch
does an amazing job at providing a simple interface to the utterly complex task of generating deployment resources, especially now that we are living in a containerd
(erm, firecracker) world.
This gist is for anyone who, like me, thinks they know better than to read all of the documentation and therefore necessari
It's relatively easy to scale out stateless web applications. You often only need a reverse proxy. But for those stateful web applications, especially those applications that embeds websocket services in them, it's always a pain to distribute them in a cluster. The traditional way is introducing some external services like Redis to handle pubsub, however, in such way, you often need to change your code. Can Erlang/Elixir, the "concurrency oriented programming languages", best other languages in this use case? Has Phoenix framework already integrated the solution of horizontally scaling websocket? I'll do an experiment to prove (or disprove) that.
# You will need fswatch installed (available in homebrew and friends) | |
# The command below will run tests and wait until fswatch writes something. | |
# The --stale flag will only run stale entries, it requires Elixir v1.3. | |
fswatch lib/ test/ | mix test --stale --listen-on-stdin |