Skip to content

Instantly share code, notes, and snippets.

View LOZORD's full-sized avatar
💭
i'm chillin

Leo Rudberg LOZORD

💭
i'm chillin
View GitHub Profile
@LOZORD
LOZORD / json_test.go
Created January 12, 2020 17:14
An example of using a native JSON-friendly Go struct as a type and input in a CEL program.
package test
import (
"bytes"
"encoding/json"
"testing"
"github.com/golang/protobuf/jsonpb"
structpb "github.com/golang/protobuf/ptypes/struct"
"github.com/google/cel-go/cel"
@LOZORD
LOZORD / wolf.go
Created January 2, 2019 02:56
An attempt at implementing a simple cellular automaton based on Wolfram's patterns (e.g. Rule 30).
package main
import (
"flag"
"fmt"
"image"
"image/color"
"image/png"
"log"
"math/rand"
@LOZORD
LOZORD / petanque.go
Created April 29, 2018 21:01
Palette-clamping (PNG) image translator. I call it petanque.
package main
// Usage:
// ./petanque -img=/path/to/input.png -colors="ABCDEF,123456,00F001"
import (
"flag"
"fmt"
"image"
"image/color"
@LOZORD
LOZORD / web-guide.md
Last active April 28, 2018 17:12
The follow-along guide for Leo's "How the Web Works" class at the Spring 2018 CUNY Hackathon.

"How the Web Works"

By Leo Rudberg (ljr@google.com). Written for the Spring 2018 CUNY Hackathon.

Link to this: https://bit.ly/2vTeHy1.

Follow me on GitHub!

(I will likely schmooze about myself here...)

@LOZORD
LOZORD / main.cpp
Created March 21, 2018 02:39
My first C++ program (started 3/1/13)
//
// main.cpp
// test!!!
//
// Created by Leo Rudberg on 3/1/13.
// Copyright (c) 2013 Leo Rudberg. All rights reserved.
//
#include <iostream>
#include <string>
@LOZORD
LOZORD / go_talk.md
Last active November 25, 2017 08:26
Let's build a server with Go!

Let's hack with Go!

In this Gist, I'll show you how to get a simple HTTP/JSON server working with the Go programming language.

Link to this guide: goo.gl/cDvRKj.

Thanks to Evan for critiquing this guide!

Intro

Go is an open source programming language made by Google and used by many developers around the world.

@LOZORD
LOZORD / ng_talk.md
Last active April 28, 2018 15:57
Angular (2 ≤) talk for CUNY Hackathon 2017
@LOZORD
LOZORD / Spell.hs
Created September 8, 2016 21:50
Haskell Norvig Spell Correcter
-- Based off of the Peter Norvig Python implementation:
-- http://norvig.com/spell-correct.html
module Spell where
import qualified Data.Map.Strict as Map
import qualified Data.List as List
import qualified Data.Set as Set
wordProbability :: Fractional v => Map.Map String v -> String -> v
wordProbability allWords myWord =
@LOZORD
LOZORD / main.c
Created September 8, 2016 05:03
Simple cgo test
#include <stdlib.h>
#include <stdio.h>
extern char * GoStrEq(char * cs1, char * st2);
int main(int argc, char ** argv) {
char * s1;
char * s2;
if (argc == 3) {
@LOZORD
LOZORD / orgiss.rb
Created August 20, 2016 23:42
A Ruby script for seeing the number of issues across a GitHub organization
#!/usr/bin/env ruby
# be sure to run `gem install octokit`
require 'octokit'
# `io/console` does not need to be installed, just required
require 'io/console'
def get_input(message, hide_entry = false)
print message + '? '
if hide_entry