This is not intended to be comprehensive or authoritative, just free online resources I've found valuable while learning more about Erlang.
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
| diff --git a/lib/middleware/visitor.rb b/lib/middleware/visitor.rb | |
| new file mode 100644 | |
| index 0000000..fdfb96d | |
| --- /dev/null | |
| +++ b/lib/middleware/visitor.rb | |
| @@ -0,0 +1,100 @@ | |
| +module Middleware | |
| + class Visitor | |
| + class Node < Struct.new(:id, :name) | |
| + end |
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 Dot | |
| class Node | |
| attr_reader :children, :name, :started | |
| attr_accessor :finished | |
| def initialize name, fields = [], started = Time.now | |
| @name = name | |
| @fields = fields | |
| @children = [] | |
| @started = started |
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
| *.c | |
| *.rl |
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
| Link: [1]RSS (alternate) | |
| NOTE:This blog had a good run, but is now in retirement. | |
| If you enjoy the content here, please support Gregory's ongoing work on | |
| the [2]Practicing Ruby journal. | |
| [3]Gregory Brown [4]James Britt [5]Robert Klemme [6]Magnus Holm | |
| [7]Ruby Best Practices |
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
| # Convenient way to fetch URLs. It follows redirections and handles SSL. Usage: | |
| # Net::HTTP.fetch_url('http://google.com') | |
| # Net::HTTP.fetch_url('https://www.google.fr/?q=ruby') | |
| module Net | |
| class HTTP | |
| def self.fetch_url(url, limit = 10) | |
| raise ArgumentError, 'HTTP redirect too deep' if limit == 0 | |
| url = URI.parse(url) | |
| options = {use_ssl: url.scheme.downcase == 'https'} | |
| request = Net::HTTP::Get.new(url.path.to_s + '?' + url.query.to_s) |
I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!
Install FFmpeg
- $ brew install ffmpeg [all your options]
- Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
Install ImageMagick
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 AssignCaseCommand < Command | |
| attribute :case, Case | |
| attribute :owner, User | |
| attribute :created_by, User | |
| attribute :comments, String | |
| attribute :distribute_at, DateTime | |
| attribute :distribute_rule_name, String | |
| attribute :require_initial, Boolean |
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
| # MODEL | |
| class Case < ActiveRecord::Base | |
| include Eventable | |
| has_many :tasks | |
| concerning :Assignment do | |
| def assign_to(new_owner:, details:) | |
| transaction do |
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
| def get_rstring(addr): | |
| s = addr.cast(string_t.pointer()) | |
| if s['basic']['flags'] & (1 << 13): | |
| return s['as']['heap']['ptr'].string() | |
| else: | |
| return s['as']['ary'].string() | |
| def get_lineno(iseq, pos): | |
| if pos != 0: | |
| pos -= 1 |