(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
| # | |
| # Current known FCC address ranges: | |
| # https://news.ycombinator.com/item?id=7716915 | |
| # | |
| # Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
| # | |
| # In your nginx.conf: | |
| location / { |
| #!/usr/bin/env ruby -wKU | |
| # Comments added 6 March 2014. | |
| # Implementation of the MetaWeblog API for my personal Ruby static blog generator. | |
| # This is not even nearly idiomatic Ruby. There are all kinds of issues. | |
| # (What's with the method interiors all being mushed-up together?) | |
| # But -- it's also worked flawlessly for five years without my having to edit it. | |
| # It won't work for anyone else as-is — but if it helps anyone | |
| # to do a MetaWeblog API implementation, then cool. |
RDBMS-based job queues have been criticized recently for being unable to handle heavy loads. And they deserve it, to some extent, because the queries used to safely lock a job have been pretty hairy. SELECT FOR UPDATE followed by an UPDATE works fine at first, but then you add more workers, and each is trying to SELECT FOR UPDATE the same row (and maybe throwing NOWAIT in there, then catching the errors and retrying), and things slow down.
On top of that, they have to actually update the row to mark it as locked, so the rest of your workers are sitting there waiting while one of them propagates its lock to disk (and the disks of however many servers you're replicating to). QueueClassic got some mileage out of the novel idea of randomly picking a row near the front of the queue to lock, but I can't still seem to get more than an an extra few hundred jobs per second out of it under heavy load.
So, many developers have started going straight t
| #!/usr/bin/env ruby | |
| require 'open3' | |
| # Returns true if all files are EOF | |
| # | |
| def all_eof(files) | |
| files.find { |f| !f.eof }.nil? | |
| end |
| 01:37 -!- Poir0t [~kvirc@2.216.115.123] has joined #webkit | |
| 01:38 < Poir0t> hey thank god i found this channell. web kit... lets talk about MY kit | |
| 01:38 < Poir0t> my kit is turgid in my pants | |
| 01:38 < Poir0t> oh yeh who wants to see my kit | |
| 01:38 < Poir0t> i got a nice huge kit | |
| 01:38 < Poir0t> woooo | |
| 01:38 < Poir0t> i am stroking my kit right now | |
| 01:38 < smfr> your web kit? | |
| 01:38 < Poir0t> who wants to talk to me while i stroke my kit ? | |
| 01:38 < Poir0t> anyone? |
| // $ clang -framework Foundation -o unicode-is-hard-lets-go-shopping unicode-is-hard-lets-go-shopping.m && ./unicode-is-hard-lets-go-shopping | |
| // 2013-03-01 17:56:56.132 unicode-is-hard-lets-go-shopping[3390:707] string1='café', string2='café', string1.length=4, string2.length=5, [string1 isEqualToString:string2]=NO | |
| // 2013-03-01 17:56:56.134 unicode-is-hard-lets-go-shopping[3390:707] precomposedString1='café', precomposedString2='café', precomposedString1.length=4, precomposedString2.length=4, [precomposedString1 isEqualToString:precomposedString2]=YES | |
| #import <Foundation/Foundation.h> | |
| int main (int argc, const char * argv[]) { | |
| @autoreleasepool { | |
| NSString *string1 = [NSString stringWithUTF8String:"\x63\x61\x66\xC3\xA9\x00"]; | |
| NSString *string2 = [NSString stringWithUTF8String:"\x63\x61\x66\x65\xCC\x81\x00"]; |
| file_to_disk = './tmp/large_disk.vdi' | |
| Vagrant::Config.run do |config| | |
| config.vm.box = 'base' | |
| config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024] | |
| config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
| end |
| #!/usr/bin/env bash | |
| # | |
| # Wraps curl with a custom-drawn progress bar. Use it just like curl: | |
| # | |
| # $ curl-progress -O http://example.com/file.tar.gz | |
| # $ curl-progress http://example.com/file.tar.gz > file.tar.gz | |
| # | |
| # All arguments to the program are passed directly to curl. Define your | |
| # custom progress bar in the `print_progress` function. | |
| # |