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
:emojisense:
Apache Conf
Better C++ Syntax
C/C++
C#
Code Runner
Compiler Explorer
DotENV
Draw.io Integration
Error Lens
@TheBrenny
TheBrenny / settings.json
Last active September 4, 2024 04:17
My TodoTree settings
{
"todo-tree.highlights.enabled": true,
"todo-tree.regex.regex": "(^[\\t ]*?)?(//|#|<!--|;|/\\*|\\s*(-|\\d+.))\\s*?($TAGS).*$",
"todo-tree.general.tags": [
"FIXME",
"FUCK",
"BUG",
"BUG/SQUASHED",
"HACK",
"TODO",
@TheBrenny
TheBrenny / keybindings.json
Last active September 4, 2024 04:16
VSCode Keybindings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+tab",
"command": "workbench.action.nextEditor"
},
{
"key": "ctrl+pagedown",
"command": "-workbench.action.nextEditor"
},
<html>
<head>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
padding: 2em;
@TheBrenny
TheBrenny / index.js
Last active August 16, 2024 06:11
Sorry, I didn't scale the data!
// x and y are arrays of -10 to +10 at steps of 0.2,
// f is the function of the answer line,
// targets is a 2d array of all f(x,y)
let x = genNumbers(-10, 10, 0.2);
let y = genNumbers(10, -10, -0.2); // 10 is min and -10 is max so it looks more normal in the array
let f = (x1, x2) => (3 * x1 + 6 * x2 - 24);
// let targets = y.map(y => y.map(x => f(x, y)));
// The random weights and bias, as well as the generated nn-node
@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'
@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"/>
@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 / 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" %*