Skip to content

Instantly share code, notes, and snippets.

View markhern's full-sized avatar

Mark Hernandez markhern

  • Virginia, U.S.A.
View GitHub Profile
use std::cmp;
use std::collections::HashMap;
use std::env;
use std::fs;
use std::fs::File;
use std::hash::Hash;
use std::io::Write;
use std::time::SystemTime;
const POWERS_OF_THREE: [u8; 5] = [1, 3, 9, 27, 81];
# Coded by Papuna Gagnidze
live_loop :beat do
with_fx :ixi_techno, phase: 1.5 do
use_synth :fm
play :d3, attack: 0.5, amp: (ring 0.3, 0.4, 0.5).look
sleep 0.25
end
end
func main() {
s := time.Now()
args := os.Args[1:]
if len(args) != 6 { // for format LogExtractor.exe -f "From Time" -t "To Time" -i "Log file directory location"
fmt.Println("Please give proper command line arguments")
return
}
startTimeArg := args[1]
finishTimeArg := args[3]
@jswny
jswny / Flexible Dockerized Phoenix Deployments.md
Last active September 5, 2025 05:27
A guide to building and running zero-dependency Phoenix (Elixir) deployments with Docker. Works with Phoenix 1.2 and 1.3.

Prelude

I. Preface and Motivation

This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.

For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai

@zupzup
zupzup / main.go
Created July 14, 2017 12:46
Example for Basic AST Traversal in Go
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/printer"
"go/token"
"log"
"os"
package main
import (
"flag"
"fmt"
"log"
"os"
"runtime/pprof"
"strconv"
"sync"