Skip to content

Instantly share code, notes, and snippets.

View sinistersnare's full-sized avatar
🕹️
Coding

Davis Silverman sinistersnare

🕹️
Coding
View GitHub Profile
@sinistersnare
sinistersnare / multiimpl.rs
Created May 9, 2014 20:50
Multiple Traits per impl block in Rust
trait MyFirstTrait {
fn my_first_func() -> ();
}
trait MySecondTrait {
fn my_second_func() -> ();
fn my_third_func() -> ();
}
struct MyStruct;
@sinistersnare
sinistersnare / 0000-ellipses-elide.md
Last active August 29, 2015 14:14
Ellipses elision in patterns instead of double-dot.
  • Start Date: (fill me in with today's date, YYYY-MM-DD)
  • RFC PR: (leave this empty)
  • Rust Issue: (leave this empty)

Summary

Use ellipses ... instead of the current double dot notation .. for elision in patterns, such as in match expressions.

example:

@sinistersnare
sinistersnare / core.clj
Last active December 23, 2015 16:59
drop.clj
(ns cljdx.core
(:require [cljdx.drop :as drop])
(:import (com.badlogic.gdx.backends.lwjgl LwjglApplication)))
(defn -main
"I don't do a whole lot."
[& args]
(LwjglApplication.
(cljdx.drop.) "Hello, Clojure!" 800 480 true))
@sinistersnare
sinistersnare / Gdx.py
Created September 27, 2013 18:25
JyGDX
from com.badlogic.gdx import ApplicationListener, Gdx
from com.badlogic.gdx.graphics.g2d import SpriteBatch
from com.badlogic.gdx.graphics import Texture, OrthographicCamera, GL10
class GdxJython(ApplicationListener):
def __init__(self):
self.camera = None
self.batch = None
@sinistersnare
sinistersnare / ideas.md
Last active December 26, 2015 01:59
Python libgdx wrapper ideas

Ideas about PyGdx, a pythonic wrapper for LibGDX Java library using Jython.

SpriteBatch

Sprite batches in java are used like so:

SpriteBatch batch = new SpriteBatch(); //init'd in create()
@sinistersnare
sinistersnare / classes.py
Created November 8, 2013 14:16
Showing a CS1 kid classes!
class Point(object):
def __init__(self,x,y):
self.x = x
self.y = y
def set(self,x,y):
self.x = x
self.y = y
def getx(self):
@sinistersnare
sinistersnare / JythonGameDev.md
Last active December 31, 2015 13:29
Markdown -> PDF Halp

% Creating Games With Python And Java % Davis Silverman

About Me

  • Ameteur programmer and game developer
  • High school now, College in the future
@sinistersnare
sinistersnare / AutoSaveSceneOnPlay.cs
Last active May 14, 2018 01:19
Auto saves current Unity scene when entering play mode.
#if UNITY_EDITOR
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEditor;
using UnityEditor.SceneManagement;
[InitializeOnLoad]
public class AutoSaveSceneOnPlay: ScriptableObject {
static AutoSaveSceneOnPlay() {
EditorApplication.playModeStateChanged += OnStateChanged;
@sinistersnare
sinistersnare / why.md
Last active February 20, 2020 02:17
My opinions on 2020 candidates. Mostly why I dont like them, but for candidates I like I may try to give rebuttals to their common critiques.

Candidacy

When I watch candidates, sometimes I hear them say something that is patently false, or completely disengenuous. How am I expected to vote for such a person? They clearly only have their own interests at heart if they know they are lying, or they are incompetent, not knowing basic facts about their opponents.

This is a short list with stuff that I wanted to write down in case it comes up in an argument :P. Hopefully, I eventually get to all candidates, including ones I support.

Also, the list has kind of morphed. It was originally critiques on candidates, now its just general thoughts, idk.

@sinistersnare
sinistersnare / Drop.java
Last active May 17, 2022 15:32
This is the gist for the "Extended Simple App" LibGDX tutorial found at: https://libgdx.com/dev/simple_game_extended/
package com.badlogic.drop;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
public class Drop extends Game {
SpriteBatch batch;
BitmapFont font;