Skip to content

Instantly share code, notes, and snippets.

@AxelRHD
AxelRHD / app.tsx
Created November 12, 2022 12:37
Cycle.JS with JSX, Typescript and Parcel (Primer)
import { jsx, VNode } from "snabbdom";
import xs from "xstream";
import { Stream } from "xstream";
import run from "@cycle/run";
import { MainDOMSource, makeDOMDriver } from "@cycle/dom";
import { IStreams, ISources } from "./interfaces";
import { Navbar } from './components/navbar'
@AxelRHD
AxelRHD / Caddyfile
Last active November 3, 2022 19:59
Elm-SPA with Caddy Dev-Server
{
auto_https off
admin :2020
}
:1235 {
handle_path /api* {
reverse_proxy :3005 #pointing to a dev-api-server
}
@AxelRHD
AxelRHD / boilerplate.jsx
Created November 18, 2021 20:45
Cycle JS boilerplate with JSX
import xs from 'xstream';
import { run } from '@cycle/run';
import { makeDOMDriver } from '@cycle/dom';
// import { makeHTTPDriver } from '@cycle/http';
import Snabbdom from 'snabbdom-pragma';
const intent = sources => {
return {
@AxelRHD
AxelRHD / index.html
Last active January 24, 2021 00:37
Cycle JS - counter M-V-I
<!DOCTYPE html>
<html>
<head>
<script src="https://npmcdn.com/xstream@5.0.6/dist/xstream.min.js"></script>
<script src="https://npmcdn.com/@cycle/dom@10.0.0-rc34/dist/cycle-dom.min.js"></script>
<script src="https://npmcdn.com/@cycle/xstream-run@3.0.2/dist/cycle.min.js"></script>
<script src="https://npmcdn.com/@cycle/http@9.0.0-rc9/dist/cycle-http-driver.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>My HTML Boilerplate</title>
</head>
<body>
<script src="./main.js"></script>

Keybase proof

I hereby claim:

  • I am AxelRHD on github.
  • I am axelrhd (https://keybase.io/axelrhd) on keybase.
  • I have a public key whose fingerprint is 43A8 8F88 AD3E 4CEE 220D D4BB 2821 E9A5 A558 BB69

To claim this, I am signing this object:

@AxelRHD
AxelRHD / goroutine-shutdown-channel.go
Created August 19, 2019 13:11
Shutdown multiple goroutines over channel
package main
import (
"log"
"sync"
"time"
)
func main() {
var wgDone sync.WaitGroup
@AxelRHD
AxelRHD / Makefile
Created July 18, 2019 19:44
Makefile for GO
# Go
GOCMD=go
XGO=xgo
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
BINARY_NAME=my-app
exec: run clean
@AxelRHD
AxelRHD / go_middleware.go
Last active April 4, 2024 00:35
GO middleware example (with gorilla/mux)
package main
import (
"fmt"
"log"
"net/http"
"github.com/gorilla/context"
"github.com/gorilla/mux"
)
@AxelRHD
AxelRHD / channeling.go
Last active July 31, 2018 21:28
Golang Snippets
package main
import (
"fmt"
"sync"
"time"
)
type message struct {
data int