Skip to content

Instantly share code, notes, and snippets.

@geecko86
geecko86 / index.js
Created July 2, 2019 14:29
Handmade load balancer for Cloudflare Workers
const europe = ["AMS", "ATH", "BCN", "BEG", "TXL", "BRU", "OTP", "BUD", "KIV", "CPH", "DUB", "DUS", "EDI", "FRA", "GVA", "GOT", "HAM", "HEL", "IST", "KBP", "LIS", "LHR", "LUX", "MAD", "MAN", "MRS", "MXP", "DME", "MUC", "LCA", "OSL", "CDG", "PRG", "KEF", "RIX", "FCO", "LED", "SOF", "ARN", "TLL", "SKG", "VIE", "VNO", "WAW", "ZAG", "ZRH"];
const africa = ["CAI", "CMN", "CPT", "DAR", "JIB", "DUR", "JNB", "LOS", "LAD", "MPM", "MBA", "MRU", "RUN", "KGL"];
const asia = ["BKK", "CEB", "CTU", "MAA", "CMB", "SZX", "FUO", "FOC", "CAN", "HGH", "HAN", "HNY", "SGN", "HKG", "HYD", "ISB", "TNA", "KHI", "KTM", "KUL", "LHE", "NAY", "LYA", "MFM", "MNL", "BOM", "NNG", "DEL", "KIX", "PNH", "TAO", "ICN", "SHA", "SHE", "SJW", "SIN", "SZV", "TPE", "TSN", "NRT", "ULN", "WUH", "WUX", "XIY", "EVN", "CGO", "CSX"];
const latinAmerica = ["ASU", "BOG", "EZE", "CWB", "FOR", "LIM", "MDE", "MEX", "PTY", "POA", "UIO", "GIG", "GRU", "SCL", "CUR"];
const middleEast = ["AMM", "BGW", "GYD", "BEY", "DOH", "DXB", "KWI", "BAH", "MCT", "ZDM", "RUH", "

Keybase proof

I hereby claim:

  • I am geecko86 on github.
  • I am geecko86 (https://keybase.io/geecko86) on keybase.
  • I have a public key whose fingerprint is 56D7 8BB9 3A35 C483 D425 21A0 69EE D163 00E0 3E6F

To claim this, I am signing this object:

@geecko86
geecko86 / mytf1.py
Created April 26, 2018 12:32
pass the public URL of a mytf1 video to open it in VLC. Made for linux.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# LPJ.py
#
# Copyright 2013 Unknown <geecko@archvaio>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@geecko86
geecko86 / gist:deeb2a9f172e937192da
Last active August 29, 2015 14:17
LyricsProviderTemplate.java
/*
* *
* * This file is part of QuickLyric
* * Created by geecko
* *
* * QuickLyric is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* *
@geecko86
geecko86 / gist:c2580bec0a3030137447
Created March 12, 2015 23:31
Get filepath from artist and title
public static String getPath(Context context, String artist, String track) {
android.os.Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
Uri MediaUri = Media.EXTERNAL_CONTENT_URI;
String[] columns = {Media.ARTIST, Media.TITLE,
Media._ID, Media.DATA};
String selection = Media.ARTIST + "=? AND " + Media.TITLE + "=?";
String[] selectionArgs = new String[]{artist, track};
Cursor mediaCursor = context.getContentResolver()
.query(MediaUri, columns, selection, selectionArgs, null);