For KVM and Laptop
I want full control what boots the computer to avoid the so called evil maid attack. That requires setting SecureBoot with only my own keys.
| // MIT License - Copyright (c) 2016 Can Güney Aksakalli | |
| // https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Net.Sockets; | |
| using System.Net; | |
| using System.IO; |
| (ns your.macros-for-cljs.ns | |
| (:require [sablono.compiler :as sablono-c])) | |
| ;; Make sablono also walk into other forms: | |
| ;; if, for, let, do: Already exist | |
| (.addMethod @(var sablono-c/compile-form) "when" | |
| (fn | |
| [[_ bindings & body]] | |
| `(when ~bindings ~@(for [x body] (sablono-c/compile-html x))))) |
| ;; implementing a React component in pure cljs, no reagent necessary | |
| ;; using goog.object.extend to create a ES6 class that inherits from | |
| ;; React.Component | |
| ;; credit to @thheller | |
| (defn MyReact [props context updater] | |
| (this-as this | |
| (js/React.Component.call this props context updater))) |
| (defmacro afor | |
| "Like for but eagerly builds a JS array. | |
| Usually for react consumption." | |
| [[item coll] & body] | |
| `(let [coll# ~coll | |
| neue# (cljs.core/array)] | |
| (loop [xs# coll# | |
| idx# 0] | |
| (let [f-item# (first xs#)] |
| // inifinite scrolling of content without extra wrappers | |
| const { render, findDOMNode } = ReactDOMFiber | |
| class App extends React.Component { | |
| render() { | |
| // wrap the root element with an Intersection Observer, exposing .observe for children | |
| return <Intersection> | |
| <div style={{ height: 200, overflow: 'auto' }}> | |
| <Page offset={0} count={10} /> | |
| </div> |
| (ns project.leaflet | |
| (:require-macros [project.macros :as m]) | |
| (:require [rum.core :as rum] | |
| cljsjs.react-leaflet)) ;; js/ReactLeaflet | |
| (m/adapt-react leaflet-map js/ReactLeaflet.Map) | |
| (m/adapt-react tile-layer js/ReactLeaflet.TileLayer) | |
| (m/adapt-react marker js/ReactLeaflet.Marker) | |
| (m/adapt-react popup js/ReactLeaflet.Popup) |
| ; Postgres listen/notify in Clojure using http://impossibl.github.io/pgjdbc-ng/ | |
| ; in project.clj dependencies | |
| ; [com.impossibl.pgjdbc-ng/pgjdbc-ng "0.5"] | |
| (ns pglisten.core | |
| (:import [com.impossibl.postgres.jdbc PGDataSource] | |
| [com.impossibl.postgres.api.jdbc PGNotificationListener])) |
For KVM and Laptop
I want full control what boots the computer to avoid the so called evil maid attack. That requires setting SecureBoot with only my own keys.
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <fcntl.h> | |
| #include <sys/stat.h> | |
| #include <sys/mman.h> | |
| #include <unistd.h> | |
| int main(int argc, const char *argv[]) | |
| { |
| ;;; strint.clj -- String interpolation for Clojure | |
| ;; originally proposed/published at http://cemerick.com/2009/12/04/string-interpolation-in-clojure/ | |
| ;; Copyright (c) 2009, 2016 Chas Emerick <[email protected]> | |
| ;; | |
| ;; All rights reserved. | |
| ;; | |
| ;; Redistribution and use in source and binary forms, with or without | |
| ;; modification, are permitted provided that the following conditions are met: | |
| ;; |