Skip to content

Instantly share code, notes, and snippets.

View alexaandru's full-sized avatar

Alexandru Ungur alexaandru

View GitHub Profile
@alexaandru
alexaandru / .signers
Last active November 22, 2024 11:35
OTP cli
alexaandru@gmail.com namespaces="git" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCx0x2FqQPAESrRfU8+TqqikuqB1F4OLDMkGdiZzsN19/59lLGPsZgQfejjHiujCWPRb0Tpz2Jv2mB6QcUVuK/gfiMbltwCdcDNCCa0I42xOgIHoYVatry7D8mZcy+t+e1TALrEUPCod4BEn8oLLnsGy6siDzv2hWINbIs2XLCvsOisa6xERgM1Joezo5+8IshSeP9felv6PqbfKEUWV0zfsoLbxJ0WAAM8T14OA/GIm12Dmg4fNWad70Bp1Yq/0W00vpZ9up+p8kMklZYlK6QHwrIw2gzVqsIL9x3FXgVw7KFRfV1Gp1W7V2S2sumzUW/BIztA0JOWqZnd0CMsSEyX
@alexaandru
alexaandru / main.go
Created November 6, 2024 14:10 — forked from tehmoon/main.go
Download from s3 in a streaming fashion
package main
import (
"net/url"
"fmt"
"github.com/tehmoon/errors"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/aws/aws-sdk-go/service/s3"
"io"
@alexaandru
alexaandru / chi.go
Created February 14, 2024 16:40
Chi-like syntactic sugar layer on top of stdlib http.ServeMux
// Chi-like syntactic sugar layer on top of stdlib http.ServeMux.
package main
import (
"net/http"
"slices"
)
type (
middleware func(http.Handler) http.Handler
@alexaandru
alexaandru / stf2017.md
Last active July 7, 2019 08:02
State of The Frontend. 2017

State of The Frontend

Special thanks to https://scotch.io/tutorials/create-a-single-page-app-with-go-echo-and-vue for resparking my interest for frontend development. It's been a while... :)

2019 Update

@alexaandru
alexaandru / about.md
Last active July 31, 2017 11:16
Minimal Golang web stack.

Mini Go Web Stack

Description

This represents a proof of concept, minimal web stack. I used http://nicolasmerouze.com/build-web-framework-golang/ series of articles as a starting point and the goal was to keep the stack as minimal as possible while still being useful for practical purposes. And of course, use the standard library as much as possible and only integrate components compatible with it.

@alexaandru
alexaandru / routing.R
Last active August 29, 2015 14:00
Visualization of "Vehicle Routing" problems & solutions
library(RColorBrewer)
# Return full path to problem data file.
dataFileFullPath <- function(fname) {
paste("data", fname, sep="/")
}
# Returns solution for a given problem.
computeSolutionFor <- function(fname) {
cacheFile <- paste("solutions", fname, sep="/")
@alexaandru
alexaandru / facility.R
Last active October 21, 2020 13:53
Visualization of "Facility Location" problem datasets
# Return full path to problem data file.
dataFileFullPath <- function(fname) {
paste("data", fname, sep="/")
}
# Returns solution for a given problem.
computeSolutionFor <- function(fname) {
# This is for the standard, python solver
#sol <- system(paste('python solver.py', dataFileFullPath(fname)), intern=T)
sol <- system(paste('./facility', dataFileFullPath(fname)), intern=T)
@alexaandru
alexaandru / monty_hall.rb
Created February 27, 2012 20:35
Monty Hall model in Ruby
#
# This class creates a model of the Monty Hall problem.
# It simulates arranging the set with prize/goats, both guest
# and Monty picking a door and then the decision to switch
# or not to switch (and of course, the outcome).
#
# Each instance of the class (MontyHall.new) runs a new
# show. Sample usage code is at the bottom.
#
class MontyHall