Skip to content

Instantly share code, notes, and snippets.

View tedigc's full-sized avatar

ted tedigc

View GitHub Profile
@tedigc
tedigc / scale-and-crop.sh
Last active February 28, 2018 17:14
Bash script for scaling all images in a directory. Includes cropping for ninepatch images
#
# Check that the correct number of arguments have been given.
#
if [ $# -ne 3 ]; then
echo
echo [Error] Usage .scale.sh input_dir output_dir scale
echo
exit 1
fi
@tedigc
tedigc / scale.sh
Created February 28, 2018 15:04
Bash script for batch-scaling images in a directory.
#!/bin/bash
#
# Check that the correct number of arguments have been given.
#
if [ "$#" -ne 3 ]; then
echo
echo "[Error]: Usage \"./scale.sh <input_dir> <output_dir> <scale>\""
echo
exit 1
@tedigc
tedigc / Player.java
Created March 15, 2018 19:31
Player class for Galaxy Garden
package com.halfcut.galaxygarden.level.object.entity.player;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Intersector;
import com.badlogic.gdx.math.Vector2;
import com.halfcut.galaxygarden.level.object.animation.Animation;
@tedigc
tedigc / send.py
Created June 16, 2018 00:09
Python snippet for sending emails with Gmail
import smtplib
from email.parser import Parser
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
USR = "<gmail_username>"
PWD = "<gmail_app_password>"
# Set up server
server = smtplib.SMTP("smtp.gmail.com", 587)
@tedigc
tedigc / Edg32.java
Created October 20, 2018 22:56
All of the colours from @ENDESGA's edg32 palette, in order of hue
package com.halfcut.galaxygarden.util;
import com.badlogic.gdx.graphics.Color;
/**
* @author halfcutdev
* @since 09/09/2017
*
* All of the colours from @ENDESGA's edg32 palette, in order of hue
*
namespace rpg {
public class StateMachine<T> {
private T entity;
private State<T> currentState;
private State<T> previousState;
private State<T> globalState;
public StateMachine(T entity, State<T> initialState, State<T> globalState = null) {
this.entity = entity;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using rpg.Source.Assets;
namespace rpg {
public class NinePatch {
private const int DefaultSpacing = 1;
private const int Bleed = 1;
{
"buttonBackgroundColor": "#77DB89",
"buttonForegroundColor": "#000",
"submitButtonText": "Submit",
"fileUrl": "https://media.wizards.com/2014/downloads/dnd/DMBasicRulesv.0.3_PrinterFriendly.pdf",
}