- compile the SendToPort.elm to elm.js
elm-make SendToPort.elm --output elm.js
- open SendToPort.html
############################################## | |
# Sample client-side OpenVPN 2.0 config file # | |
# for connecting to multi-client server. # | |
# # | |
# This configuration can be used by multiple # | |
# clients, however each client should have # | |
# its own cert and key files. # | |
# # | |
# On Windows, you might want to rename this # | |
# file so it has a .ovpn extension # |
(use '[datomic.api :as d]) | |
(def uri "datomic:free://localhost:4334/git") | |
(def conn (d/connect uri)) | |
(def rules | |
'[[(node-files ?n ?f) [?n :node/object ?f] [?f :git/type :blob]] | |
[(node-files ?n ?f) [?n :node/object ?t] [?t :git/type :tree] | |
[?t :tree/nodes ?n2] (node-files ?n2 ?f)] | |
[(object-nodes ?o ?n) [?n :node/object ?o]] | |
[(object-nodes ?o ?n) [?n2 :node/object ?o] [?t :tree/nodes ?n2] (object-nodes ?t ?n)] | |
[(commit-files ?c ?f) [?c :commit/tree ?root] (node-files ?root ?f)] |
input { | |
tcp { | |
port => 514 | |
type => syslog | |
} | |
udp { | |
port => 514 | |
type => syslog | |
} | |
} |
guard 'shell', :elixirc_bin => "/usr/local/elixirc" do | |
watch(/(.+\.ex$)/) { |m| `elixirc #{m[0]}` } | |
end | |
guard 'shell', :elixir_bin => "/usr/local/elixir" do | |
watch(/(.+\.exs$)/) { |m| `elixir #{m[0]}` } | |
end |
# This version: | |
# brings WiFi in from the Huawei adapter on eth1 | |
# pushes WiFi out from the built in adapter on wlan0 | |
# sets up an ip address on 192.168.5.2 to ssh into from another computer | |
################################################## | |
# Update | |
# | |
#sudo apt-get update | |
#sudo apt-get -qq upgrade |
(ns foami.core | |
"FOreign Asynchronous Mechanism Interop" | |
(:require [clojure.core.async :as async])) | |
(defn put! | |
"Takes a `ch`, a `msg`, a single arg function that when passed `true` enables backpressure | |
and when passed `false` disables it, and a no-arg function which, when invoked, closes the | |
upstream source." | |
[ch msg backpressure! close!] | |
(let [status (atom :sending] |
(ns udp-ping.core | |
(:require [clojure.core.async :refer [>! <! chan go close! thread]]) | |
(:import (java.net DatagramPacket InetAddress MulticastSocket))) | |
(def port 10001) | |
(def group (InetAddress/getByName "224.1.0.0")) | |
(def buffer-size 1000) | |
(defprotocol Socket | |
(send! [this msg]) |
It’s not so easy to get *ns*
string in ClojureScript as you might expect but here is a tip.
It is impossible to get *ns*
string at run-time in ClojureScript (except in self-hosted ClojureScript) but it can be accessed at compile-time only. So you have to use a macro to get it as the following example.
I came up with this idea in the course of implementing set-ns-blacklist!
and set-ns-whitelist!
(https://github.com/philoskim/debux#debux-config) in my debux library.
; http://stackoverflow.com/questions/31269170/event-count-at-certain-time-interval-in-riemann | |
(let [email (mailer {:host "localhost" | |
:port 1025 | |
:from "abc@gmail.com"})] | |
(streams | |
(where (and (service "system_log") | |
(description "IE") | |
(not (expired? event))) | |
; we are interested in the event count, so let's fix to :metric 1 |