Skip to content

Instantly share code, notes, and snippets.

@candlerb
candlerb / go-project-layout.md
Last active October 1, 2024 08:33
Suggestions for go project layout

If someone asked me the question "what layout should I use for my Go code repository?", I'd start by asking back "what are you building: an executable, or a library?"

Single executable

Stage 1: single source file

Create a directory named however you want your final executable to be called (e.g. "mycommand"), change into that directory, and create the following files:

# *.home.mydomain.name is configured as a catchall CNAME in my DNS provider to point to the Caddy box.
# That way, everything needed to add a new subdomain/service is adding it in this file and reloading Caddy.
...
project-1.home.mydomain.name {
respond "This will be provided as a static HTTP response"
}
project-2.home.mydomain.name {
# HTTP basic authentication. Static hosted content served directly by Caddy.
@scorpius
scorpius / Install TurboTax 2021 in Windows 7.md
Last active February 9, 2025 01:12
How to Install TurboTax Deluxe 2021 in Windows 7

How to Install TurboTax Deluxe 2021 in Windows 7

Run the TurboTax installer until the error dialog pops up. Click the close button since you can't go any further. Now press WinKey-R and type %TEMP% to go to the temporary folder. Copy the ckz_XXXX folder to the desktop. Select the Setup.exe file and press CTRL-C then CTRL-V to make a copy/backup.

Now use radare as follows:

Command Description
r2 -A -w SetUp.exe analyze and allow writing (thanks to @SureshotM6)
axt str.CurrentVersion look for references to this string
@douglasmiranda
douglasmiranda / pdf-to-svg.md
Last active October 24, 2025 01:06
About PDF to SVG converters

Update in 2024

In 2024 I'm actually having a good time using mupdf.

About my experience with mupdf:

It's written in C, but you can use it in many ways. Command line, python lib (pymupdf), js, and others.

I still coundn't find issues that I had with other tools and weird broken PDFs, so I'd say pretty good.

anonymous
anonymous / test.go
Created January 5, 2018 02:39
Gitlab Available Two-Character Names Script
// This code is published under GNU GPL v3+. For more information, visit http://www.gnu.org/licenses/gpl.html
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
@tzmartin
tzmartin / embedded-file-viewer.md
Last active October 23, 2025 12:08
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@adrobisch
adrobisch / hateoas.raml
Created May 17, 2016 13:33
HATEOAS with RAML 1.0
#%RAML 1.0
title: HATEOAS example
types:
Link:
type: object
properties:
rel: string
href?:
type: string
@cdipaolo
cdipaolo / HaversinFormula.go
Created April 15, 2015 01:31
Golang functions to calculate the distance in meters between long,lat points on Earth.
// haversin(θ) function
func hsin(theta float64) float64 {
return math.Pow(math.Sin(theta/2), 2)
}
// Distance function returns the distance (in meters) between two points of
// a given longitude and latitude relatively accurately (using a spherical
// approximation of the Earth) through the Haversin Distance Formula for
// great arc distance on a sphere with accuracy for small distances
//
@staltz
staltz / introrx.md
Last active October 26, 2025 03:06
The introduction to Reactive Programming you've been missing
@mschoebel
mschoebel / main.go
Created March 6, 2014 20:02
Snippet: login/logout (Golang)
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling