Skip to content

Instantly share code, notes, and snippets.

Avatar
🕹️
Probably procrastinating

Jason Chu 1lann

🕹️
Probably procrastinating
View GitHub Profile
View ping.go
package main
import (
"crypto/rand"
"encoding/binary"
"flag"
"fmt"
"net"
"os"
"time"
View goroutines.lua
-- 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 Feb 26, 2018
Getting more storage space on UniFi AC Lite/LR on OpenWrt
View storage.md

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.

Well, have you ever wondered why you needed to flash the firmware twice when you first install OpenWrt on a UniFi Lite/LR? Once to kernel0 and another to kernel1? That's because we (OpenWrt community/developers) do not know how Ubiquiti's UniFi U-Boot decides which partition to boot from, as it can boot from either kernel0 or kernel1. Hence we flash to both partitions.

View badger.go
package main
import (
"fmt"
"sync"
"github.com/dgraph-io/badger/badger"
)
func main() {
@1lann
1lann / bot.go
Last active Feb 4, 2017
A bot that posts notifications about new comments and posts on the Riot API Developer Forums.
View bot.go
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"strconv"
"strings"
@1lann
1lann / gearing.py
Created Nov 11, 2016
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.
View gearing.py
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):
View goroutines.lua
-- 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)
View keybase.md

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:

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