Skip to content

Instantly share code, notes, and snippets.

View SupaHam's full-sized avatar

Ali SupaHam

View GitHub Profile
@file:Suppress("NOTHING_TO_INLINE")
package org.jetbrains.anko
import android.app.Fragment
import android.view.View
/*
* This class must be named Dialogs2 to not override Anko.
*/
@SupaHam
SupaHam / Fibonacci.java
Created April 21, 2016 03:49
Very efficient Fibonacci algorithm that caches previous values to save on calculation times
package com.supaham.test;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.Map;
public class Fibonacci {
private static Map<BigInteger, BigInteger> fibIndex = new HashMap<>();
private static final BigInteger TWO = BigInteger.valueOf(2);

Keybase proof

I hereby claim:

  • I am SupaHam on github.
  • I am supaham (https://keybase.io/supaham) on keybase.
  • I have a public key whose fingerprint is C4F1 BE2F E64C ABBD 43F9 8FBB 10CA 6F8E 9D46 2049

To claim this, I am signing this object:

2.times do
play 60
sleep 0.7
play 62
sleep 0.7
play 64
sleep 0.7
play 60
sleep 0.8
end
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@SupaHam
SupaHam / deploy.py
Last active August 29, 2015 14:20
Server instance deploying script.
#!/usr/bin/python
import os, sys, yaml, shutil
homeDir = "/home/minecraft/"
serversDir = "/home/minecraft/"
dataDir = homeDir + ".deploy/"
srvTemplate = dataDir + "template"
# FILES
mcProps = "server.properties"
@SupaHam
SupaHam / blocks.json
Last active August 29, 2015 14:19
Minecraft Block registry. Indexed mapColors and materials. (not minified)
{
"mapColors": [
{
"index": 0,
"color": 0
},
{
"index": 1,
"color": 8368696
},
@SupaHam
SupaHam / blocks.json
Last active August 29, 2015 14:19
Minecraft Block registry. Indexed mapColors and materials.
{"mapColors":[{"index":0,"color":0},{"index":1,"color":8368696},{"index":2,"color":16247203},{"index":3,"color":10987431},{"index":4,"color":16711680},{"index":5,"color":10526975},{"index":6,"color":10987431},{"index":7,"color":31744},{"index":8,"color":16777215},{"index":9,"color":10791096},{"index":10,"color":12020271},{"index":11,"color":7368816},{"index":12,"color":4210943},{"index":13,"color":6837042},{"index":14,"color":16776437},{"index":15,"color":14188339},{"index":16,"color":11685080},{"index":17,"color":6724056},{"index":18,"color":15066419},{"index":19,"color":8375321},{"index":20,"color":15892389},{"index":21,"color":5000268},{"index":22,"color":10066329},{"index":23,"color":5013401},{"index":24,"color":8339378},{"index":25,"color":3361970},{"index":26,"color":6704179},{"index":27,"color":6717235},{"index":28,"color":10040115},{"index":29,"color":1644825},{"index":30,"color":16445005},{"index":31,"color":6085589},{"index":32,"color":4882687},{"index":33,"color":55610},{"index":34,"color":1381407}
@SupaHam
SupaHam / minecraft font widths
Last active August 17, 2023 16:20
Minecraft character widths
! length 2
" length 5
# length 6
$ length 6
% length 6
& length 6
' length 3
( length 5
) length 5
* length 5
@SupaHam
SupaHam / gist:6bc4a0b781e03e7eacd5
Created March 29, 2015 02:30
dmulloy at his finest.
#8 (comment)
Oh gee, thanks mister! I had no idea there was a deprecation annotation, it's not like I've used it before or anything.
PacketWrapper is generated almost completely by a script because honestly I don't have the time or will to create 50+ wrappers. If you do, you're more than welcome to do so.
I reaaally don't appreciate your condescending attitude. This is a FREE tool. I allow anyone to use it free of charge. I don't work for you and I'm under no obligation to make sure your precious old features still work. If you want someone to fix something for you, the absolute worst way to go about it is to be condescending.
Also, thanks for providing examples, it really helps.