Skip to content

Instantly share code, notes, and snippets.

View profelis's full-sized avatar

Dima Granetchi profelis

View GitHub Profile
@oscarcs
oscarcs / HelloWorld.scala
Last active July 22, 2023 06:11
Scala & LWJGL Hello World
import org.lwjgl._
import org.lwjgl.glfw._
import org.lwjgl.opengl._
import org.lwjgl.glfw.Callbacks._
import org.lwjgl.glfw.GLFW._
import org.lwjgl.opengl.GL11._
import org.lwjgl.system.MemoryUtil._
object Main {
@nadako
nadako / Main.hx
Created June 24, 2015 19:36
Haxe + SDL = native love \o/
class Main {
static function main() {
Sdl.init(Sdl.INIT_EVERYTHING);
var win = Sdl.createWindow("Hello", 100, 100, 800, 600, Sdl.WINDOW_OPENGL);
var ren = Sdl.createRenderer(win, -1, Sdl.RENDERER_ACCELERATED);
var bmp = Sdl.loadBMP("test.bmp");
var tex = Sdl.createTextureFromSurface(ren, bmp);
Sdl.freeSurface(bmp);
for (i in 0...3) {
@jasononeil
jasononeil / Metric.hx
Last active November 10, 2016 11:16
Demonstration of using Haxe abstracts to take care of explicit conversions between different units of measurement, with no performance overhead.
class Metric {
static function main() {
var coinRadius:Millimeters = 12;
var myHeight:Centimeters = 180;
var raceLength:Meters = 200;
var commuteDistance:Kilometers = 23;
diff( coinRadius, myHeight ); // 1.788 meters
diff( raceLength, commuteDistance ); // 22800 meters
sum( commuteDistance, coinRadius ); // 23000.012 meters
@tong
tong / neko
Last active May 21, 2016 08:24
bash/zsh completion for neko
#!bash
#
# bash/zsh completion support for neko/nekotools/nekoml/nekoc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
@tong
tong / haxelib-completion.sh
Last active December 25, 2015 21:03
Haxelib shell completion script
#!bash
#
# Haxelib bash completion (3.2.0-rc.3)
#
__haxelib_commands() {
echo "install upgrade update remove list set search info user config path version help submit register local dev git setup newrepo deleterepo selfupdate convertxml run proxy"
}
_haxelib_complete(){
@tong
tong / haxe-completion.sh
Last active December 14, 2015 05:49
Haxe shell completion script
#!bash
#
# Haxe bash completion
#
__haxe_commands() {
echo "-cp -js -swf -as3 -neko -php -cpp -cs -java -python -xml -main -lib -D -v -debug -dce -swf-version -swf-header -swf-lib -swf-lib-extern -java-lib -net-lib -net-std -c-arg -x -resource -prompt -cmd --flash-strict --no-traces --gen-hx-classes --next --each --display --no-output --times --no-inline --no-opt --php-front --php-lib --php-prefix --remap --interp --macro --eval --wait --connect --cwd -version --help-defines --help-metas -help --help"
}
_haxe_complete() {
@hexonaut
hexonaut / Memory.hx
Created May 31, 2012 22:36
flash.Memory patch to remove alchemy dependancies
package flash;
#if !flash_no_alchemy extern #end class Memory {
#if flash_no_alchemy
private static var mem:flash.utils.ByteArray = prepareInitialByteArray();
private static function prepareInitialByteArray ():flash.utils.ByteArray {
var b = new flash.utils.ByteArray();
b.endian = flash.utils.Endian.LITTLE_ENDIAN;