Skip to content

Instantly share code, notes, and snippets.

🕹️
Coding

Davis Silverman sinistersnare

🕹️
Coding
Block or report user

Report or block sinistersnare

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sinistersnare
sinistersnare / why.md
Last active Feb 20, 2020
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.
View why.md

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 / AutoSaveSceneOnPlay.cs
Last active May 14, 2018
Auto saves current Unity scene when entering play mode.
View AutoSaveSceneOnPlay.cs
#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 / 0000-ellipses-elide.md
Last active Aug 29, 2015
Ellipses elision in patterns instead of double-dot.
View 0000-ellipses-elide.md
  • 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 / multiimpl.rs
Created May 9, 2014
Multiple Traits per impl block in Rust
View multiimpl.rs
trait MyFirstTrait {
fn my_first_func() -> ();
}
trait MySecondTrait {
fn my_second_func() -> ();
fn my_third_func() -> ();
}
struct MyStruct;
@sinistersnare
sinistersnare / JythonGameDev.md
Last active Dec 31, 2015
Markdown -> PDF Halp
View JythonGameDev.md

% Creating Games With Python And Java % Davis Silverman

About Me

  • Ameteur programmer and game developer
  • High school now, College in the future
@sinistersnare
sinistersnare / classes.py
Created Nov 8, 2013
Showing a CS1 kid classes!
View classes.py
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 / ideas.md
Last active Dec 26, 2015
Python libgdx wrapper ideas
View ideas.md

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()
View Gdx.py
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
View core.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 / Drop.java
Last active Feb 2, 2020
This is the gist for the "Extended Simple App" LibGDX tutorial found at: https://github.com/libgdx/libgdx/wiki/Extending-the-simple-game
View Drop.java
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;
You can’t perform that action at this time.