Skip to content

Instantly share code, notes, and snippets.

View ngmaloney's full-sized avatar

Nick Maloney ngmaloney

View GitHub Profile
### Keybase proof
I hereby claim:
* I am ngmaloney on github.
* I am gnarco (https://keybase.io/gnarco) on keybase.
* I have a public key ASBtQYsM8i3EpzkdqEjWdKu4kL8zhVupFx4R4IPTTckSkgo
To claim this, I am signing this object:
@ngmaloney
ngmaloney / typescript.cr
Last active January 8, 2020 04:15
typescript.cr
require "duktape"
class Typescript
TYPESCRIPT_PATH = "deps/libs/ts/typescriptServices.js"
def initialize(ts_file : String)
@ts_file = ts_file
@ctx = Duktape::Sandbox.new
@ctx.eval!("ts = require('typescript')")
end
@ngmaloney
ngmaloney / main.go
Created January 4, 2021 14:58
Example go service that uses bearer tokens instead of JWT tokens.
package main
import (
"crypto/rand"
"encoding/hex"
"encoding/json"
"log"
"net/http"
"strings"
@ngmaloney
ngmaloney / map_extract.rb
Last active February 10, 2022 13:42
Naive solution for finding a map page on a PDF by word frequency
require 'rmagick'
require 'rtesseract'
## Utility for extracting the map page from a survey_map pdf
class Utils::MapExtract
attr_reader :pdf_file, :images
def initialize(pdf_file)
@pdf_file = pdf_file
@images = []