Skip to content

Instantly share code, notes, and snippets.

View TheBrenny's full-sized avatar
🎧
Spin tunes and rave

Jarod TheBrenny

🎧
Spin tunes and rave
View GitHub Profile
@TheBrenny
TheBrenny / plaxify.css
Last active July 31, 2016 16:34
Plax without silly jQuery bloat!
span{
position: absolute;
top: 50%;
left: 50%;
text-shadow: 0 0 4px #FFFFFF;
font-size: 30px;
font-weight:bold;
font-family: Helvetica, Arial, sans-serif;
}
#l1{z-index: 18;}
@TheBrenny
TheBrenny / AngleSpeed.java
Last active December 15, 2018 18:23
Raycasting my homebrew'd way using linear functions and their x and y intercepts! The map is (theoretically) infinite in length along both axis' leading into the negative and positive. (See also: https://www.desmos.com/calculator/axjo4hkzxg)
public class AngleSpeed extends Vector {
protected float xSpeed;
protected float ySpeed;
public AngleSpeed(AngleSpeed old) {
this(old.distance, old.xSpeed, old.ySpeed, old.angle.getAngle());
}
public AngleSpeed(float speed, float xSpeed, float ySpeed, float angle) {
super(angle, speed);
@TheBrenny
TheBrenny / JavaFormatProfile.xml
Last active March 2, 2020 04:52
VSCode vs Eclipse Formatting
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="Jarod" version="13">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
@TheBrenny
TheBrenny / main.dart
Last active July 17, 2020 06:23
Extending DateTime
void main() {
var now = new DateTime.now();
var later = now.add(const Duration(seconds: 5));
print("now > later == ${now > later}");
print("now >= later == ${now >= later}");
print("now < later == ${now < later}");
print("now <= later == ${now <= later}");
}
extension BetterDateTime on DateTime {
@TheBrenny
TheBrenny / alias.cmd
Last active August 26, 2020 07:56
Create aliases using JS
@ECHO off
SETLOCAL
SET curdir=%~dp0
SET fileCalled=%~n0
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
"%_prog%" "%curdir%\js\%fileCalled%.js" %*
@TheBrenny
TheBrenny / formatting-profile.xml
Last active September 28, 2020 05:24
My Java formatting profile
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="Jarod" version="13">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<html>
<head>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
padding: 2em;
@TheBrenny
TheBrenny / matchAll polyfill.js
Last active February 24, 2023 19:23
A polyfill for the String.prototype.matchAll method. Only available in Node12+ and most browsers.
if(!String.prototype.matchAll) {
String.prototype.matchAll = function (rx) {
if (typeof rx === "string") rx = new RegExp(rx, "g"); // coerce a string to be a global regex
rx = new RegExp(rx); // Clone the regex so we don't update the last index on the regex they pass us
let cap = []; // the single capture
let all = []; // all the captures (return this)
while ((cap = rx.exec(this)) !== null) all.push(cap); // execute and add
return all; // profit!
};
}
@TheBrenny
TheBrenny / Better Node Repl.md
Last active March 2, 2023 00:28
A set of global variables to help in a NodeJS REPL.

Save the below nodeRepl.js file to somewhere special (like ~/.whatever). To take advantage of it in a Node REPL, you need to require it before, or when in, the REPL. An easy way to do this is by running node.exe -r ~/.whatever/nodeRepl.js, so it can have all the globals prepared for you.

Also, there's no notable lag hit, which is a big win!

I've also added my Windows Terminal profiles which I use to help me win!

ENJOY!

@TheBrenny
TheBrenny / my.bash_aliases
Last active October 18, 2023 01:21
A set of my common bash aliases for use in linux terminals
# Update Aliases
getAliases () {
cp ~/.bash_aliases ~/bkp.bash_aliases
curl -o ~/.bash_aliases https://gist.githubusercontent.com/TheBrenny/5982fc550b8faf6b190b579c965d77fb/raw/my.bash_aliases
. ~/.bash_aliases
}
# Console adjustments
alias cl='clear'
alias cls='clear;ls'