Example of a more complicated EventStore projection using GitHub API data
EventStore L&L
- Download EventStore (Mono(SL) vs Windows)
- Running EventStore from the command-line (w/projections)
- Logging in to the UI
- Setting a default ACL (using curl)
local M = {} | |
local B = bit or bit32 or require("catppuccin.lib.native_bit") | |
local hash_str = function(str) -- MurmurOAAT_32, https://stackoverflow.com/questions/7666509/hash-function-for-string | |
local hash = 0x12345678 | |
local tbl = { string.byte(str, 1, #str) } | |
for i = 1, #tbl do | |
hash = B.bxor(hash, tbl[i]) | |
hash = hash * 0x5bd1e995 | |
hash = B.bxor(hash, B.rshift(hash, 15)) |
awk 'BEGIN{ | |
s="/\\/\\/\\/\\/\\"; s=s s s s s s s s s s s s s s s s s s s s s s s; | |
for (colnum = 0; colnum<256; colnum++) { | |
r = 255-(colnum*255/255); | |
g = (colnum*510/255); | |
b = (colnum*255/255); | |
if (g>255) g = 510-g; | |
printf "\033[48;2;%d;%d;%dm", r,g,b; | |
printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b; | |
printf "%s\033[0m", substr(s,colnum+1,1); |
# Push an IssuesEvent into ES (with known issue number) | |
curl -i -L -d @example-issues-event.json http://127.0.0.1:2113/streams/github-IssuesEvent -H "Content-Type:application/json" -H "ES-EventType:IssuesEvent" -u "admin:changeit" | |
# Push a PushEvent into ES (has a commit description with required match) | |
curl -i -L -d @example-push-event.json http://127.0.0.1:2113/streams/github-PushEvent -H "Content-Type:application/json" -H "ES-EventType:PushEvent" -u "admin:changeit" | |
# Push a DeploymentEvent into ES (has a description with required match) | |
curl -i -L -d @example-DeploymentEvent-desc.json http://127.0.0.1:2113/streams/github-DeploymentEvent -H "Content-Type:application/json" -H "ES-EventType:DeploymentEvent" -u "admin:changeit" |
#!/bin/bash | |
# THESE ARE NOTES, NOT TESTED AS SCRIPT! | |
# We need the following to get and run teamcity agent | |
sudo apt-get install openjdk-7-jre-headless | |
sudo apt-get install unzip #For unzipping buildAgent.zip | |
# For compiling Simple.Web | |
sudo apt-get install ruby1.9.1 |
inline fun Int.divides(d: Int) : Boolean { return this % d == 0 } | |
fun main(args: Array<String>) : Unit { | |
var i = 0 | |
iterate { i++ } take 100 forEach { | |
println( | |
when (true) { | |
it.divides(15) -> "fizzbuzz" | |
it.divides(3) -> "fizz" |
Example of a more complicated EventStore projection using GitHub API data
on alfred_script(q) | |
if isAppRunning("iTerm") then | |
tell application "iTerm" | |
set myterm to (make new terminal) | |
tell myterm | |
set mysession to (make new session at the end of sessions) | |
tell mysession | |
exec command "/bin/zsh -l" | |
end tell | |
end tell |
namespace SimpleWebTest.Tests.Acceptance | |
{ | |
using SimpleWebTest; | |
using Xunit; | |
public class GetEndpointTests : IDisposable | |
{ | |
private const string port = 5000; | |
namespace ConsoleApplication26 | |
{ | |
using System; | |
using System.Collections.Generic; | |
using Simple.Web; | |
using Simple.Web.Behaviors; | |
internal class Program | |
{ |