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:
| ;; 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:
To claim this, I am signing this object:
| ;; 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` |
| (require 'sml-mode) | |
| (global-set-key (kbd "C-c S") 'sml-run) | |
| ;; Requires sml binary on PATH... | |
| ;; export PATH=$PATH:/usr/local/smlnj/bin | |
| ;; README | |
| ;; To load a file and run sml repl -> Press C-c C-v inside a sml file. | |
| ;; To run the current files tests -> Press C-c C-r inside a sml file. It assumes the tests are inside the same directory. | |
| ;; For example, If your code file is hw1.sml your test file should be named as hw1test.sml in the same directory |
| (defrecord Server [service-map] | |
| component/Lifecycle | |
| (start [component] | |
| (info :msg "Starting server.") | |
| (let [server (bootstrap/create-server (:service-map service-map))] | |
| (bootstrap/start server) | |
| (assoc component :server server))) | |
| (stop [component] | |
| (info :msg "Stopping server.") | |
| (update-in component [:server] bootstrap/stop))) |
| # Given a client_secrets.json file, authenticate via OAuth to the | |
| # Google Drive API and list all files in the account. | |
| # Setup: | |
| ## gem install google-api-client | |
| ## Under Google Developers Console, enable the Drive API and Drive SDK. | |
| ### Under Credentials > OAuth, create a new client ID. | |
| #### This provides the client_secrets.json. | |
| #### The Redirect URI must exactly match what the app actually sends. |
| (ns clj.core) | |
| (def nums | |
| (range 0 10)) | |
| (defn fair [] | |
| (rand-nth nums)) |
| require 'rubygems' | |
| require 'set' | |
| require 'hpricot' | |
| require 'mechanize' | |
| USER_ACCOUNT = "[email protected]" | |
| PASSWORD = ARGV[0] | |
| MAX_LINKS = 200 | |
| SLEEP_INTERVAL = 0.5 |
| 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) |
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.