| Author: | Baiju Muthukadan |
|---|---|
| Email: | baiju.m.mail AT gmail.com |
| Version: | 0.3.2 |
Gist to describe the process of adding a namespaced isolated Rails Engine
to a typical Rails application and adding methods to one of the Rails Engine's
controller and model.
- Rails applicaiton all by itself.
- Rails application with the Rails Engine (FooBar) mounted.
- Rails applicaiton partially extending a controller/model from the Rails Engine.
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
| ;; Using org-mode to describe state transitions with embedded elisp to | |
| ;; emit those state transitions as a graphical flow-chart via dot | |
| ;; | |
| ;; Modified with minor improvements from https://orgmode.org/worg/org-tutorials/org-dot-diagrams.html | |
| ;; | |
| ;; Place cursor in elisp code-block, eval with `C-c C-c`. | |
| #+NAME: nodes | |
| | *node* | *label* | *shape* | *fillcolor* | fg | | |
| |-----------------------------+------------------------------------+---------+----------------+-------| |
I hereby claim:
- I am daemianmack on github.
- I am daemianmack (https://keybase.io/daemianmack) on keybase.
- I have a public key ASBZsZGf8hZMjhky1EhdpMx66syKxnW9y1YYQyHwC8xGdgo
To claim this, I am signing this object:
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
| ;; I use this to wrap the `dev-system` in a way that... | |
| ;; - Alerts me when the system launch completes so I can do something | |
| ;; else while waiting, without getting sidetracked | |
| ;; - Alerts me when the system launch hangs | |
| ;; - Runs Eastwood | |
| ;; - Squelches logging from namespaces whose logging statements | |
| ;; frequently mask the logging I'm trying to see | |
| ;; I put this in ./dev and then | |
| ;; `printf ":/Users/daemian/src/ww/elephant/dev" >> build/cached-classpath` |
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
| (ns clj.core) | |
| (def nums | |
| (range 0 10)) | |
| (defn fair [] | |
| (rand-nth nums)) |
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 'rubygems' | |
| require 'set' | |
| require 'hpricot' | |
| require 'mechanize' | |
| USER_ACCOUNT = "dmack@federatedmedia.net" | |
| PASSWORD = ARGV[0] | |
| MAX_LINKS = 200 | |
| SLEEP_INTERVAL = 0.5 |
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 Regular(object): | |
| def __init__(self): | |
| self.num = self.caller(5) | |
| def not_inner(self, x): | |
| return x * x | |
| def caller(self, num): | |
| return self.not_inner(num) |
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
| ;; | |
| ;; NS CHEATSHEET | |
| ;; | |
| ;; * :require makes functions available with a namespace prefix. | |
| ;; | |
| ;; * :use makes functions available without a namespace prefix | |
| ;; (i.e., refers functions to the current namespace). | |
| ;; | |
| ;; * :import refers Java classes to the current namespace. | |
| ;; |
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 Ns | |
| def initialize | |
| use.each do |pkg, method_names| | |
| method_names.each do |name| | |
| self.class.send(:define_method, name) do |*args| | |
| pkg.method(name).call(*args) | |
| end | |
| end | |
| end | |
| end |
NewerOlder