Skip to content

Instantly share code, notes, and snippets.

View thasmin's full-sized avatar

Dan Goldstein thasmin

View GitHub Profile

Keybase proof

I hereby claim:

  • I am thasmin on github.
  • I am thasmin (https://keybase.io/thasmin) on keybase.
  • I have a public key ASAtnB0haorRXzWNlcVtL4rYq6sDo5NFIFZrVQrfZsmzPwo

To claim this, I am signing this object:

@thasmin
thasmin / br-kotlin-test.kt
Last active February 28, 2018 00:23
Hey, this is Dan Goldstein. This is my solution to the Kotlin Test. I hope this is what you were looking for. Please feel free to call me at 469-226-6061 or email me at dan@axelby.com.
import java.time.LocalDateTime
enum class AssetType { VIDEO, IMAGE, AD }
open class Asset(
val id: Int,
val name: String,
val type: AssetType,
val expiration: LocalDateTime) {
@thasmin
thasmin / libmpg123 index file
Created November 21, 2014 07:18
speed up libmpg123 seeks after opening a file by saving the index in a file
// save / restore index for fast seeking
size_t idx_fill;
off_t idx_step;
off_t* idx_offsets;
FILE* index_file = fopen(index_fn, "rb");
if (index_file != NULL) {
fread(&idx_fill, sizeof(size_t), 1, index_file);
fread(&idx_step, sizeof(off_t), 1, index_file);
idx_offsets = malloc(idx_fill * sizeof(off_t));
fread(idx_offsets, sizeof(off_t), idx_fill, index_file);
@thasmin
thasmin / gist:889840
Created March 28, 2011 01:15
mirah override bug in java
// A.java
// Generated from temp.mirah
public class A extends java.lang.Object {
public long func(int i) {
return ((long)(i));
}
}
// B.java
// Generated from temp.mirah
@thasmin
thasmin / gist:889836
Created March 28, 2011 01:09
mirah overriding method bug
class A
def func(i:int):long
long(i)
end
end
class B < A
def func(i:int):int
i + 10
end