I have moved the regular expression example repository to the regular GitHub site to encourage contributions.
diff -Nr -U 1000 tmp/generated/v2.3.18/.gitignore tmp/generated/v3.0.0/.gitignore | |
--- tmp/generated/v2.3.18/.gitignore 1969-12-31 16:00:00.000000000 -0800 | |
+++ tmp/generated/v3.0.0/.gitignore 2014-02-21 19:34:53.000000000 -0800 | |
@@ -0,0 +1,4 @@ | |
+.bundle | |
+db/*.sqlite3 | |
+log/*.log | |
+tmp/**/* | |
diff -Nr -U 1000 tmp/generated/v2.3.18/Gemfile tmp/generated/v3.0.0/Gemfile | |
--- tmp/generated/v2.3.18/Gemfile 1969-12-31 16:00:00.000000000 -0800 |
Top 50 tests by objects allocated | |
224624: EagerLoadPolyAssocsTest#test_include_query | |
212146: SchemaDumperDefaultsTest#test_schema_dump_defaults_with_universally_supported_types | |
172186: EagerAssociationTest#test_eager_with_multiple_associations_with_same_table_has_many_and_habtm | |
154367: AttributeMethodsTest#test_time_zone_aware_attribute_saved | |
107256: MigrationTest#test_migrator_versions | |
105861: MigrationTest#test_filtering_migrations | |
104094: MigrationTest#test_migration_without_transaction | |
98828: MigrationTest#test_add_table_with_decimals |
require 'mail' | |
require 'resolv' | |
require 'net/telnet' | |
class EmailAddressValidator < ActiveModel::EachValidator | |
attr_reader :mail | |
def validate_each(record, attribute, value) | |
return if options[:allow_nil] && value.nil? |
# | |
# Apparently this has been in Ruby since 1.9.3... who knew? | |
# Also check out sized queue class | |
# | |
require 'thread' | |
# | |
# Create a new thread that blocks on queue pop | |
# Create an "exit" channel to send "stop" message when total of 100 is reached | |
# |
(by @andrestaltz)
So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
--- | |
# file: roles/app/tasks/main.yml | |
- name: ensure logging directory exists | |
file: path=/var/log/acme state=directory | |
tags: | |
- install | |
- name: ensure config directory exists | |
file: path=/etc/acme/app state=directory |
New approach:
-
spawn('sh', ...)
Find the
-c
arg.Parse, and split up by
&&
and||
and|
and;
, expanding each bit.Then spawn the exploded command line. When we explode it, we need to do the same thing with looking up env and shebang results.
require 'securerandom' | |
require 'benchmark' | |
# written to allow 65,536 unique array items | |
array_of_x = lambda {|x| SecureRandom.hex(x*2).scan(/..../) } | |
module Refinements | |
module BooleanUniqWithDupUniqBang | |
refine Array do | |
def uniq? |
require 'digest' | |
require 'net/http' | |
gem_file = 'rubygems-update-2.4.8.gem' | |
# Reference: https://rubygems.org/gems/rubygems-update/versions/2.4.8 | |
sha256hash = "dbed858db605923d9cc77080de1a5f1ce6ac3c68924877c78665e0d85d7b3e73" | |
################################################## | |
# Download the Gem from RubyGems.org (over HTTPS) |