Skip to content

Instantly share code, notes, and snippets.

View Hyperparticle's full-sized avatar
📝
Researching

Dan Kondratyuk Hyperparticle

📝
Researching
View GitHub Profile
@Hyperparticle
Hyperparticle / TrafficAnimation.java
Last active August 29, 2015 14:12
Bad use of arrays for the first project in my first intro to Java class. I used arrays even though we didn't cover them in class because I thought I was being smart.
/*
* TrafficAnimation.java
* COMPSCI 121 Project 1: Traffic Animation
*/
/**
* Animates two cars traveling at different speeds which wrap
* back around to their starting position.
*
* @author Me
// This file provides useful Kotlin tricks for common tasks
// that would be otherwise tedious to do in Java
/**
* Read from stdin line by line, halting when EOF is reached.
* Super useful for building a simple REPL or parsing a text file.
*/
fun readLineByLine() {
System.`in`.reader().forEachLine { line ->
// Do your stuff here
@Hyperparticle
Hyperparticle / login.robot
Last active June 4, 2017 20:29
Robot Framework example
*** Settings ***
Documentation A test suite with a single test for valid login.
...
... This test has a workflow that is created using keywords in
... the imported resource file.
Resource resource.txt
*** Test Cases ***
A User Can Create an Account and Log In
Create Valid User fred P4ssw0rd
@Hyperparticle
Hyperparticle / login.py
Last active June 4, 2017 19:54
Robot Framework Python driver example
class LoginLibrary(object):
# Some setup logic
def __init__(self):
self._sut_path = os.path.join(os.path.dirname(__file__),
'..', 'sut', 'login.py')
self._status = ''
def _run_command(self, command, *args):
command = [sys.executable, self._sut_path, command] + list(args)
process = subprocess.Popen(command, universal_newlines=True, stdout=subprocess.PIPE,
@Hyperparticle
Hyperparticle / controller.py
Created June 5, 2017 02:22
Robot Framework Python controller
class Controller(object):
def __init__(self):
self._sut_path = os.path.join(os.path.dirname(__file__),
'..', 'sut', 'login.py')
self._status = ''
self.logger = logging.getLogger('localhost', 3456)
handler = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s')
@Hyperparticle
Hyperparticle / config.yml
Last active November 9, 2021 09:29
CircleCI 2.0 Jekyll build and Firebase deploy
### Taken from https://github.com/Hyperparticle/hyperparticle.github.io/blob/2365749469b1eea3e8c4b18af24a4865fc426fd3/.circleci/config.yml
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
@Hyperparticle
Hyperparticle / responsive-iframe.css
Created October 22, 2017 22:31
How to make a rounded, responsive iframe (resizes dynamically)
.rounded {
position: relative;
border-radius: 10px; /* Rounded corners */
padding-bottom: 62.5%; /* 16:10 ratio */
height: 0;
overflow: hidden;
}
.rounded .frame {
position: absolute;
@Hyperparticle
Hyperparticle / TestPolygon.cs
Last active June 25, 2022 04:57
Draw a polygon mesh in Unity
public class TestPolygon : MonoBehaviour
{
private void Start () {
// Create Vector2 vertices
var vertices2D = new Vector2[] {
new Vector2(0,0),
new Vector2(0,1),
new Vector2(1,1),
new Vector2(1,2),
new Vector2(0,2),
@Hyperparticle
Hyperparticle / DrawControllerV0.cs
Last active November 28, 2017 15:59
Draw Controller - Version 0
public class DrawController : MonoBehaviour
{
public DrawRectangle RectanglePrefab;
private readonly List<DrawRectangle> _allShapes = new List<DrawRectangle>();
private DrawRectangle CurrentShapeToDraw { get; set; }
private bool IsDrawingShape { get; set; }
private void Update()
@Hyperparticle
Hyperparticle / DrawRectangleV0.cs
Last active November 24, 2017 13:03
Rectangle Prefab Script - Version 0
public class DrawRectangle : MonoBehaviour
{
public Color FillColor = Color.white;
private MeshFilter _meshFilter;
private LineRenderer _lineRenderer;
// Start and end vertices (in absolute coordinates)
private readonly List<Vector2> _vertices = new List<Vector2>(2);