-
In the root component render, the props (which we can get with
(om/props this)
) is result of(parser {:state db} query)
.db
is the result of normalization process of our initdata. -
Delivering root component props to sub component is left to us, no automatic procession that is done by
om/add-root!
, e.g. noparser
involvment, normalization, etc. -
Thinks that normalization process is only matters to simplify change/update process.
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
/* | |
This is the equivalent minimal demo of the above using ES6 class to define React component | |
*/ | |
// Parent | |
class Parent extends React.Component { |
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
Show hidden characters
{ | |
"plugins": ["transform-es2015-destructuring", | |
"transform-object-rest-spread"], | |
"presets": ["es2015"] | |
} |
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
Asked and answered here: | |
https://ask.openstack.org/en/question/51392/neutron-openvswitch-port-how-to-disable-source-ip-address-checking/ | |
In short, there are "allowed-address-pairs" that can alternatively used to solve such a problem. | |
Some scenario like: | |
- An instance has two ports in two different subnet, one belong in e.g. 10.1.1.123 (eth0) | |
and the other one in 10.1.2.223 (eth1). |
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
;; Add dependencies live on lein repl | |
;; ------------------------------ | |
; in project.clj, add to dependencies vector: [com.cemerick/pomegranate "0.3.0"] | |
[com.cemerick/pomegranate "0.3.1"] | |
; example adding deps via repl | |
(cemerick.pomegranate/add-dependencies | |
:coordinates '[[midje "1.8.2"]] | |
:repositories (merge cemerick.pomegranate.aether/maven-central |
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
;; Demonstrating how to deliver props from Root to 3rd level children with om.next | |
;; [Root] 1---M [Org] 1---M [Group] 1---M [User] | |
(ns om-tutorial.core | |
(:require [goog.dom :as gdom] | |
[om.next :as om :refer-macros [defui]] | |
[om.dom :as dom] | |
[cljs.pprint :refer [pprint]])) | |
(enable-console-print!) |
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
;; Ring handler is just, just plain old function | |
(defn always-ok-handler [request] | |
"OK") | |
;; Attach one single handler per http-server instance | |
;; This http-server will always response with "OK" no matter what | |
;; request it was given. |
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 pcap.core | |
(:require | |
[clj-net-pcap.core :as pcore] | |
[taoensso.timbre :as timbre]) | |
(:import | |
org.jnetpcap.packet.PcapPacket | |
org.jnetpcap.protocol.JProtocol | |
[org.jnetpcap.protocol.lan | |
Ethernet] | |
[org.jnetpcap.protocol.network |
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
# derived from: | |
# https://github.com/mike01/pypacker/blob/master/examples/examples.py | |
from pypacker import ppcap | |
from pypacker.layer12 import ethernet | |
from pypacker.layer3 import ip, icmp, ip6 | |
from pypacker.layer4 import udp, tcp | |
with open("/tmp/test.cap", mode='rb') as f: | |
pcap = ppcap.Reader(f) |
NewerOlder