I hereby claim:
- I am sfcgeorge on github.
- I am sfcgeorge (https://keybase.io/sfcgeorge) on keybase.
- I have a public key ASCbgmrBCz_87ERTRKj2j_VQgtSIRfLz4aUq7rXokPf-zwo
To claim this, I am signing this object:
| # This is the original algorithm with some renaming for clarity. | |
| # DFS recursive function returns true if a matching for a_index is possible | |
| def mcbm_can_match(graph, a_index, matches, seen): | |
| # Try every resource one by one | |
| for r_index in range(len(graph[0])): | |
| # If resource at r_index can do assignment and assignment is not seen | |
| if graph[a_index][r_index] and seen[r_index] == False: | |
| # Mark resource as visited | |
| seen[r_index] = True |
| # frozen_string_literal: true | |
| require 'rails' | |
| require 'scenic' | |
| module Scenic | |
| # @api private | |
| module SchemaDumper | |
| private |
I hereby claim:
To claim this, I am signing this object:
| # frozen_string_literal: true | |
| # https://github.com/Shopify/graphql-batch/blob/master/examples/association_loader.rb | |
| require 'graphql/batch' | |
| class AssociationLoader < GraphQL::Batch::Loader | |
| def initialize(association_name) | |
| @association_name = association_name | |
| end |
| Framework | Multi platform | Native code | Native UI | Native widgets | Declarative UI | Native UX |
|---|---|---|---|---|---|---|
| Native | no | yes | yes | yes | no | yes |
| Ruby Motion | mobile | yes | yes | yes | no | yes |
| Cordova | mobile | yes | yes | yes | no | yes |
| RNW | yes | no | yes | no | yes | with effort |
| NativeScript | yes | no | yes | no | yes | with effort |
| Flutter | yes (web coming) | yes | yes | no | yes | maybe |
| Cordova | yes | no | no | no | yes | no |
| CREATE FUNCTION count_estimate(query text) RETURNS integer AS $$ | |
| DECLARE | |
| rec record; | |
| rows integer; | |
| row integer; | |
| BEGIN | |
| rows := 1; | |
| FOR rec IN EXECUTE 'EXPLAIN ' || query LOOP | |
| row := substring(rec."QUERY PLAN" FROM ' rows=([[:digit:]]+)')::integer; | |
| IF (row != 0) THEN rows := rows * row; END IF; |
The purpose here is to show a high level overview of how Rails concepts map to Hyperloop concepts. It's not a full tutorial (I started doing that but it was way too long), but examples of key points.
Here's a simple auth example, with a comment showing all you have to add to hook it up to Hyperloop. In a production app you'd probably use Devise, but the Hyperloop acting_user bit would be the same!
| module ActiveSupport | |
| # A typical module looks like this: | |
| # | |
| # module M | |
| # def self.included(base) | |
| # base.extend ClassMethods | |
| # base.class_eval do | |
| # scope :disabled, -> { where(disabled: true) } | |
| # end | |
| # end |
| require "pp" | |
| MAPPING = { | |
| 1 => [], | |
| 2 => %w(A B C), | |
| 3 => %w(D E F), | |
| 4 => %w(G H I), | |
| 5 => %w(J K L), | |
| 6 => %w(M N O), | |
| 7 => %w(P Q R S), |
| require "json" | |
| class JsonSlop | |
| def initialize(json) | |
| @hash = json.is_a?(String) ? JSON.parse(json) : json | |
| end | |
| def call | |
| JsonSlopProxy.new(@hash) | |
| end |