Skip to content

Instantly share code, notes, and snippets.

Cygon

Block or report user

Report or block Cygon

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
@Cygon
Cygon / take-sequential-screenshot.sh
Last active Mar 28, 2018
Takes a screenshot of a predefined area of the desktop
View take-sequential-screenshot.sh
#!/bin/bash
# Takes a screenshot of a predefined area of your desktop
# Good for comparison images and making animations where FPS is too low for OBS
#
# Dependencies:
# - scrot
# - graphicsmagick
# Change these values to match your preferences
@Cygon
Cygon / preventing-too-large-code-units.md
Created Mar 12, 2018
Thoughts on Preventing Large Code Units
View preventing-too-large-code-units.md

If you've ever ended up in the unlucky position of maintaining a poorly maintained codebase, you may know why experienced programmers generally advocate for smaller units of code.

Uncontrolled Growth

The amount of code (or design) a human being can keep in active memory is limited, thus, if a unit of code is allowed to grow until the mental limit of the average team member is exceeded, code just gets /piled/ on top of what already existed. The capacity for suffering through this is sometimes astounding and a single unit of code can spiral into thousands of lines of features piled on top of each other with no knowledge of the assumptions and patterns that were once present in the rest of the code.

Of course, the solution is to break it down into smaller units a single mind can pick up and understand.

@Cygon
Cygon / prefer-static-methods-for-nonmutating-operations.md
Last active Nov 11, 2017
Prefer Static Methods for Non-Mutating Operations
View prefer-static-methods-for-nonmutating-operations.md

Prefer Static Methods for Non-Mutating Operations

When writing instance methods that do not change the state of their instance but rather return a modified copy of the instance, it is often better to implement these methods as static methods accepting an instance as an argument rather as a argument-less instance method.

DO NOT Return Mutated State from Instance Methods

@Cygon
Cygon / document-conditions-with-local-variables.md
Last active Oct 26, 2017
Document Conditions with Local Variables
View document-conditions-with-local-variables.md

Document Conditions with Local Variables

When many factors weigh into a condition, the condition statement can become unreadable, especially if combined with a poor line wrapping technique. This is a very basic technique that achieve much better readability when writing conditions.

DO NOT: Write complex conditions directly in if statements

@Cygon
Cygon / dealing-with-player-input.md
Last active Oct 26, 2017
Dealing with Player Input in Games
View dealing-with-player-input.md

Dealing with Player Input in Games

Some notes on implementing player input in video games.

I've seen many games and even engines that implement player input processing in a way that makes it very hard to run unit tests on input consuming controllers and that create unnecessary dependencies from the game's movement code to whatever input library or engine is being used.

@Cygon
Cygon / gentoo-steamvr-system-report
Created Jun 28, 2017
A system report created by SteamVR on Gentoo Linux where SteamVR failed to connect to an HTC Vive
View gentoo-steamvr-system-report
SteamVR System Report created Wed Jun 28 10:58:46 2017
<Report>
SteamVR Version: 1497390325
SteamVR Date: 2017-06-13
Steam: Public
Steam Branch:
Steam AppID: 250820
Tracking: No Driver
OS: Linux version 4.9.16-gentoo (root@tiamat) (gcc version 5.4.0 (Gentoo 5.4.0-r3 p1.3, pie-0.6.5) ) #3 SMP Sun Jun 18 18:36:30 CEST 2017
You can’t perform that action at this time.