Skip to content

Instantly share code, notes, and snippets.

View 1lann's full-sized avatar

Jason Chu 1lann

View GitHub Profile
package main
import (
"crypto/rand"
"encoding/binary"
"flag"
"fmt"
"net"
"os"
"time"
-- Goroutines for ComputerCraft!
-- Made by 1lann (Jason Chu)
-- Last updated: 31st July 2015
--[[
Licensed under the MIT License:
The MIT License (MIT)
Copyright (c) 2015 1lann (Jason Chu)
@1lann
1lann / storage.md
Last active February 10, 2024 13:47
Getting more storage space on UniFi AC Lite/LR on OpenWrt

2024 UPDATE

This is not necessary anymore on newer versions of OpenWrt. When you flash a sysupgrade firmware on newer versions of OpenWrt via the web interface it will provide you full access to the flash.

Getting more space on UniFi AC Lite/LRs on OpenWrt

If you've used OpenWrt on UniFi AC Lite/LRs, you may know that the overlayfs only provides 3.6 MB of space. If you think about it, that's kinda weird, because all the hardware docs say that the access point has 16 MB of flash, so where did all the other 12.4 MBs go? Surely they're not all being taken up by the OS.

package main
import (
"fmt"
"sync"
"github.com/dgraph-io/badger/badger"
)
func main() {
@1lann
1lann / bot.go
Last active February 4, 2017 03:26
A bot that posts notifications about new comments and posts on the Riot API Developer Forums.
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"strconv"
"strings"
@1lann
1lann / gearing.py
Created November 11, 2016 19:39
gearing_up_for_destruction Google foobar solution. I'm posting this because I'm angry that foobar glitched up and ate my solution, and `submit` didn't actually go through. `verify` however said it passed all tests. Oh well, I'll post it here for science.
from fractions import Fraction
def invert(matrix):
n = len(matrix)
inverse = [[Fraction(0) for col in range(n)] for row in range(n)]
for i in range(n):
inverse[i][i] = Fraction(1)
for i in range(n):
-- Goroutines for ComputerCraft!
-- Made by 1lann (Jason Chu)
-- Last updated: 31st July 2015
--[[
Licensed under the MIT License:
The MIT License (MIT)
Copyright (c) 2015 1lann (Jason Chu)

Keybase proof

I hereby claim:

  • I am 1lann on github.
  • I am 1lann (https://keybase.io/1lann) on keybase.
  • I have a public key whose fingerprint is 5503 BCF2 EC0C DB3C A0A2 8ADA 4B3F 51DB 88EC 5DBD

To claim this, I am signing this object:

[{
"period": "2016 4",
"statistics": [{
"tier": "BRONZE",
"values": {
"assists": 1290718,
"deaths": 881788,
"double_kills": 90478,
"kills": 893516,
"losses": 65738,
package main
import (
"fmt"
"unsafe"
)
type plank struct {
size int
cuts []int