This file contains 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 pulsar-test.core | |
(:import (org.apache.pulsar.client.api PulsarClient))) | |
(defn make-consumer | |
[] | |
(let [props (doto (java.util.Properties.) | |
(.putAll {"userId" "super" | |
"password" "superpass"})) | |
client (-> (PulsarClient/builder) | |
(.serviceUrl "pulsar://localhost:6650") |
This file contains 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
<?xml version="1.0"?> | |
<alloy> | |
<view> | |
<defaultnode/> | |
<defaultedge/> | |
<node> |
This file contains 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
{-# LANGUAGE ScopedTypeVariables #-} | |
-- https://stackoverflow.com/questions/2075912/generate-a-random-binary-number-with-a-variable-proportion-of-1-bits | |
import Control.Monad (replicateM) | |
import Data.Bits | |
import Data.Foldable (foldl') | |
import Data.Word (Word8) | |
import Numeric.Natural (Natural) | |
import System.Random (Random, randomIO) |
This file contains 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
stack ls snapshots -l remote | rg -o 'lts-[0-9]+\.[0-9]+' | sort -rn | head -n1 | |
stack ls snapshots -l remote | grep -Eo 'lts-[0-9]+\.[0-9]+' | sort -rn | head -n1 |
This file contains 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
# Original source: https://github.com/terry-xiaoyu/schema-registry-examples/blob/master/avro/avro_mqtt.py | |
import paho.mqtt.client as mqtt | |
import io | |
import json | |
import avro.schema | |
import avro.datafile | |
import avro.io | |
import avro.ipc | |
import time |
This file contains 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
// Generate `person_pb2.py` by running `protoc --python_out=. person.proto` before | |
// running `protobuf_mqtt.py` | |
syntax = "proto2"; | |
package tutorial; | |
message Person { | |
required string name = 1; | |
required int32 id = 2; |
This file contains 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
# Original source: https://github.com/terry-xiaoyu/schema-registry-examples/blob/master/avro/avro_mqtt.py | |
import paho.mqtt.client as mqtt | |
import io | |
import json | |
import avro.schema | |
import avro.datafile | |
import avro.io | |
import avro.ipc | |
import time |
This file contains 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
// Generate `person_pb2.py` by running `protoc --python_out=. person.proto` before | |
// running `protobuf_mqtt.py` | |
syntax = "proto2"; | |
package tutorial; | |
message Person { | |
required string name = 1; | |
required int32 id = 2; |
This file contains 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
#!/bin/bash -x | |
####################################################################### | |
# | |
# Demo of Erlang IDL, as applied to property testing of Java code. | |
# We'll need Triq. | |
git clone git://github.com/krestenkrab/triq.git | |
(cd triq && ./rebar compile) | |
ERL_ROOT=`erl -noshell -eval 'io:format("~s\n", [code:root_dir()]), init:stop().'` |
This file contains 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
/* ==UserStyle== | |
@name github.com - Jan 2024 | |
@namespace github.com/openstyles/stylus | |
@version 1.0.0 | |
@description A new userstyle | |
@author Me | |
==/UserStyle== */ | |
@-moz-document domain("github.com") { | |
/* in firefox you may need to set layout.css.has-selector.enabled to true in order for this to work */ |