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
| type _ trepr = | |
| | Int : int trepr | |
| | Bool : bool trepr | |
| | List : 'a trepr -> 'a list trepr | |
| let bool_to_string = function | |
| | true -> "True" | |
| | false -> "False" | |
| let int_to_string = Printf.sprintf "%d" |
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
| trap "kill 0" SIGINT SIGTERM EXIT | |
| make watch_assets & | |
| make run |
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
| System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Mono.TextEditor.Highlighting.ResourceXmlProvider.Open'. | |
| at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) | |
| at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /private/tmp/source/bockbuild-crypto-mono/profiles/mono-mac-xamarin/build-root/mono-3.0.10/mcs/class/corlib/System.Reflection/MonoMethod.cs:552 | |
| --- End of inner exception stack trace --- | |
| at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00013] in /private/tmp/source/bockbuild-crypto-mono/profiles/mono-mac-xamarin/build-root/mono-3.0.10/mcs/class/corlib/System.Reflection/MonoMethod.cs:558 | |
| at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x000af] in /private/tmp/source/b |
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
| module LikeRoutes | |
| def self.registered(app) | |
| url_for_like = app.url(app.record_name, | |
| "#{app.base_url}/:id/like") | |
| app.get url_for_like do | |
| # ... | |
| end | |
| end | |
| 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 Cuba | |
| module Render | |
| def render(template, locals = {}, options = {}, &block) | |
| _cache.fetch(template) { | |
| Tilt.new(template, 1, options.merge(outvar: '@_output') | |
| }.render(self, locals, &block) | |
| end | |
| end | |
| 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 MyRender << Fiasco::Render | |
| def render(name, locals = {}) | |
| if ENV['RACK_ENV'] == 'development' && @templates[name] | |
| @compiled.delete(name) | |
| declare(name, @templates[name].filename) | |
| end | |
| super(name, locals) | |
| end | |
| 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
| (import (chibi io) (chibi process)) | |
| (define (for-each-line proc port) | |
| (let loop ((line (read-line port))) | |
| (cond ((not (eof-object? line)) | |
| (proc line) | |
| (loop (read-line port)))))) | |
| (call-with-process-io '("ls" "/tmp") | |
| (lambda (pid in out err) |
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
| (import (scheme) (clojure pipeline) (chibi test)) | |
| (test | |
| "(-> 3.0 (- 2) (* 5) sqrt)" | |
| (sqrt (* (- 3.0 2) 5)) | |
| (-> 3.0 (- 2) (* 5) sqrt)) | |
| (test | |
| "(->> 3.0 (- 5) (* 5) sqrt)" | |
| (sqrt (* 5 (- 5 3.0))) |
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
| function mkgemsenv -d "Creates a gemset env in the current directory" | |
| mkdir -p ".gemsenv/ENV" | |
| echo (pwd)"/.gemsenv" > ".gemsenv/ENV/GEM_HOME" | |
| echo (pwd)"/.gemsenv:"(gem env path) > ".gemsenv/ENV/GEM_PATH" | |
| echo (pwd)"/.gemsenv/bin:"(sh -c 'echo $PATH') > ".gemsenv/ENV/PATH" | |
| end | |
| function usegemsenv -d "Starts a new shell using the gemset env in the current directory" | |
| envdir .gemsenv/ENV $SHELL | |
| 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
| (datatype option-type | |
| ______________ | |
| @nothing : (option A); | |
| X : Type; | |
| ______________ | |
| (@just X) : (option Type); | |
| _____________ | |
| (just? X) : verified >> X : (option A);) |