This project has moved to https://github.com/jonhoo/drwmutex so it can be imported into Go applications.
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
(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.
This file contains hidden or 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
class HTTPRouter | |
self() | |
self.routes = { } | |
end | |
add(verb is String, path is String, func is Function) | |
self.routes[#self.routes + 1] = Route(verb, path, func) | |
end | |
match(verb, path) | |
for i=1, #self.routes do | |
m, q = self.routes[i].match(verb, path) |
Find it here: https://github.com/bitemyapp/learnhaskell
This file contains hidden or 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
### | |
# Execute tests in parallel using multiple processes. Uses DRb to communicate | |
# between processes over a unix socket. | |
gem 'minitest', '~> 5.1.0' | |
require 'minitest' | |
require 'minitest/spec' | |
require 'minitest/mock' | |
require 'drb' | |
require 'drb/unix' |
This file contains hidden or 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
require 'fiddle' | |
class GVL | |
handle = Fiddle::Handle::DEFAULT | |
address = handle['rb_thread_blocking_region'] | |
func = Fiddle::Function.new address, [Fiddle::TYPE_VOIDP, | |
Fiddle::TYPE_VOIDP, | |
Fiddle::TYPE_VOIDP, | |
Fiddle::TYPE_VOIDP], Fiddle::TYPE_VOIDP |
This file contains hidden or 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
# config/initializers/source_maps.rb | |
if Rails.env.development? | |
module CoffeeScript | |
class SourceMapError < StandardError; end; | |
class << self | |
def compile script, options | |
script = script.read if script.respond_to?(:read) |
This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.
- Haskell is a functional programming language.
This file contains hidden or 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
# navigation | |
# ctrl + A - moves to the start of the line | |
# ctrl + E - moves to the end of the line | |
# ctrl + B - move back on character | |
# ctrl + F - move forward one character | |
# esc + B - move back one word | |
# esc + F - move forward one word | |
# alt + <-/-> | |
# ctrl + U - delete from the cursor to the beginning of the line | |
# ctrl + K - delete from the cursor to the end of the line |
NewerOlder