Skip to content

Instantly share code, notes, and snippets.

View doytsujin's full-sized avatar
🎯
Private Account

Alexander Chernov doytsujin

🎯
Private Account
View GitHub Profile
@doytsujin
doytsujin / Proxy.scala
Created November 3, 2022 00:36 — forked from mikalv/Proxy.scala
Minimal akka http proxy
package akkahttptest
import akka.actor.ActorSystem
import akka.http.Http
import akka.stream.FlowMaterializer
import akka.http.server._
import akka.http.marshalling.PredefinedToResponseMarshallers._
import akka.stream.scaladsl.{HeadSink, Source}
object Proxy extends App {
@doytsujin
doytsujin / Proxy.scala
Created November 3, 2022 00:35 — forked from rklaehn/Proxy.scala
Minimal akka http proxy
package akkahttptest
import akka.actor.ActorSystem
import akka.http.Http
import akka.stream.FlowMaterializer
import akka.http.server._
import akka.http.marshalling.PredefinedToResponseMarshallers._
import akka.stream.scaladsl.{HeadSink, Source}
object Proxy extends App {
@doytsujin
doytsujin / proxy.scala
Created November 3, 2022 00:21 — forked from retronym/proxy.scala
proxy.scala
package mapmap
trait ECtx
trait KCtx
trait Var[C, T] {
def get(c: C): T
}
package controllers
import config.{EndpointConfig => Config}
import play.api.mvc._
import play.api.Play.current
import play.api.libs.ws.{WSRequest, WS}
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
@doytsujin
doytsujin / FunctionBotRun.csx
Created October 22, 2022 17:09 — forked from christopheranderson/FunctionBotRun.csx
An Azure Function implementing the Microsoft Bot Framework to return random quotes
using System.Net;
using Microsoft.Bot.Connector;
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
log.Verbose($"C# HTTP trigger function processed a request. RequestUri={req.RequestUri}");
var msg = await req.Content.ReadAsAsync<Message>();
@doytsujin
doytsujin / git-pr
Created September 26, 2022 02:14 — forked from PVince81/git-pr
Open the Github Pull Request page for the current branch with optional target branch
#!/bin/bash
# Inspired by http://www.devthought.com/code/create-a-github-pull-request-from-the-terminal/
targetbranch=master
if test "$1"; then
targetbranch=$1
fi
repo=`git remote -v | grep -m 1 "(push)" | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"`
@doytsujin
doytsujin / tmux-switch-pane.sh
Created September 23, 2022 23:39 — forked from thugcee/tmux-switch-pane.sh
tmux and fzf: fuzzy tmux session/window/pane switcher (this version uses tmux new popup window)
#!/bin/bash
# customizable
LIST_DATA="#{window_name} #{pane_title} #{pane_current_path} #{pane_current_command}"
FZF_COMMAND="fzf-tmux -p --delimiter=: --with-nth 4 --color=hl:2"
# do not change
TARGET_SPEC="#{session_name}:#{window_id}:#{pane_id}:"
# select pane
@doytsujin
doytsujin / docker-maven-ghactions-release.md
Created September 23, 2022 13:46 — forked from faph/docker-maven-ghactions-release.md
Automated Docker releases using Maven and GitHub Actions

Automated Docker releases using Maven and GitHub Actions

Life is too short for tedious, manual release processes.

Here, we will use Maven's [Release plugin][maven-release] to execute releases. Instead of triggering the release process manually, we will use a [GitHub Actions][gh-actions] workflow on the master branch. All development work is done on the dev branch (or feature branches) and a release is done when (and only when) the dev branch is merged with the master branch.

@doytsujin
doytsujin / gist:99867a5ddee93e4ff8c02b3aad11cdde
Created September 19, 2022 22:19 — forked from yamamushi/gist:dd7e7f5791ce497e68a4
Setting up a modern C++ development environment on Linux with Clang and Emacs
This was mirrored from the snapshot of earthserver.com available on archive.org
--------------------------------------------------------------------------------
Setting up a modern C++ development environment on Linux with Clang and Emacs
I am an independent game developer and this is my personal wiki.
Please feel free to email [email protected], and to follow @Earthserver
(Redirected from Setting up a C++11 development environment on Linux with Clang and Emacs)
@doytsujin
doytsujin / privatednszones.tf
Created August 11, 2022 15:42 — forked from liamfoneill/privatednszones.tf
Creates Azure Private DNS Zones for all of the Azure PaaS Services that (currently) support Private Endpoints. NOTE: For some services, like AKS the DNS Zones need to be regionalised so you will need 1 zone for each region. I have included North and West Europe as examples. If you are using DNS Servers to resolve these records you will also need…
resource "azurerm_resource_group" "dnsprivatezones" {
name = "connectivity-dnsprivatezones-001"
location = "West Europe"
tags = {
"Usage" = "Azure Private DNS Zones for Private Endpoints"
}
}
resource "azurerm_private_dns_zone" "azureautomation" {
name = "privatelink.azure-automation.net"
resource_group_name = azurerm_resource_group.dnsprivatezones.name