(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| (ns leaflet-helloworld | |
| (:require [om.core :as om :include-macros true] | |
| [om.dom :as dom :include-macros true])) | |
| (defn map-view [_ owner] | |
| (reify | |
| om/IRender | |
| (render [_] | |
| (dom/div #js {:id "the-map"} nil)) | |
| om/IDidMount |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| (ns reagent-test.core | |
| (:require [reagent.core :as reagent :refer [atom]] | |
| [datascript :as d] | |
| [cljs-uuid-utils :as uuid])) | |
| (enable-console-print!) | |
| (defn bind | |
| ([conn q] | |
| (bind conn q (atom nil))) |
| // A. Cannot use type switch outside of a switch statement | |
| type PolarVortex interface {} | |
| func main() { | |
| var p PolarVortex = new(PolarVortex) | |
| var s = p.(type) // compilation error => use of .(type) outside type switch | |
| } | |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| " Set colorscheme to solarized | |
| colorscheme solarized | |
| " Change the Solarized background to dark or light depending upon the time of | |
| " day (5 refers to 5AM and 17 to 5PM). Change the background only if it is not | |
| " already set to the value we want. | |
| function! SetSolarizedBackground() | |
| if strftime("%H") >= 5 && strftime("%H") < 17 | |
| if &background != 'light' | |
| set background=light |
| def select_from_chosen(item_text, options) | |
| field = find_field(options[:from]) | |
| option_value = page.evaluate_script("$(\"##{field[:id]} option:contains('#{item_text}')\").val()") | |
| page.execute_script("$('##{field[:id]}').val('#{option_value}')") | |
| end |
| module ValueObject | |
| def self.new(*attrs) | |
| klass = Class.new(Object) | |
| klass.send(:attr_reader, *attrs) | |
| klass.send(:define_method, :initialize) do |*args| | |
| raise ArgumentError, "wrong number of arguments (#{args.size} for #{attrs.size})" unless args.size == attrs.size | |
| attrs.each_with_index do |attr, idx| | |
| instance_variable_set("@#{attr}", args[idx]) |
| --- a/load.c 2010-10-23 05:36:38.000000000 -0400 | |
| +++ b/patchload.c 2011-06-05 08:58:00.000000000 -0400 | |
| @@ -40,14 +40,6 @@ | |
| VALUE ary; | |
| long i; | |
| - for (i = 0; i < RARRAY_LEN(load_path); ++i) { | |
| - VALUE str = rb_check_string_type(RARRAY_PTR(load_path)[i]); | |
| - if (NIL_P(str) || !rb_is_absolute_path(RSTRING_PTR(str))) | |
| - goto relative_path_found; |