Skip to content

Instantly share code, notes, and snippets.

View joeybeninghove's full-sized avatar

Joey Beninghove joeybeninghove

View GitHub Profile
@joeybeninghove
joeybeninghove / ILRepack.targets
Created February 24, 2025 03:43
Quantower Post-Build Event (with ILRepack)
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RunILRepack>true</RunILRepack>
</PropertyGroup>
<Target Name="ILRepacker" AfterTargets="Build" Condition="'$(RunILRepack)' == 'true'">
<ItemGroup>
<InputAssemblies Include="$(OutputPath)\<your-assembly>.dll"/>
<InputAssemblies Include="$(OutputPath)\<some-third-party-assembly>.dll"/>
@joeybeninghove
joeybeninghove / Quantower.targets
Created February 24, 2025 03:40
Quantower Post-Build Event
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="CopyToQuantower" AfterTargets="PostBuildEvent">
<Copy SourceFiles="$(OutputPath)$(AssemblyName).dll" DestinationFolder="C:\Quantower\Settings\Scripts\Strategies"/>
</Target>
</Project>
[Subject(typeof(TradeManager))]
class when_price_is_updated
{
static ITradeManager subject;
static Mock<ILevelRepository> level_repository;
static Mock<IBroker> broker;
static Mock<ILevel> level;
static Mock<IStopLoss> stop_loss;
static Mock<IConfiguration> configuration;
static Mock<ITakeProfit> take_profit;
@joeybeninghove
joeybeninghove / ILogger.cs
Last active January 29, 2025 00:53
Logging Abstraction Around Quantower
public interface ILogger
{
void Log(string message, LogLevel level = LogLevel.Info);
}
@joeybeninghove
joeybeninghove / adb.md
Created January 16, 2025 23:56
Wirelessly Deploy Code to Rev Robotics Control Hub

To wirelessly connect to a Rev Robotics Control Hub and compile/deploy code from Android Studio using ADB (Android Debug Bridge), follow these steps:


Prerequisites

  1. Ensure Android Studio is installed and configured on your computer.
  2. Make sure your FTC Robot Controller app is set up on the Control Hub.
  3. Install ADB on your computer (if not already included with Android Studio).

/* Copyright Lydia & M1
Take it, I don't care
Programming is just copying
*/
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.Servo;
@joeybeninghove
joeybeninghove / toggle_controller.js
Created February 5, 2021 17:02
Toggle Controller
import { Controller } from 'stimulus'
export default class extends Controller {
static targets = ['content', 'keyword', 'iconDown', 'iconUp']
toggle () {
if (this.contentTarget.classList.contains('hidden')) {
this.showContent()
this.changeKeyword('Hide')
} else {
@joeybeninghove
joeybeninghove / simple_form.rb
Created December 17, 2020 05:08
simple_form + flatpickr
config.wrappers :flatpickr, class: 'mb-6 relative' do |b|
b.use :html5
b.use :label, class: 'mb-2'
b.wrapper tag: :div, html: {
data: {
controller: 'flatpickr',
wrap: true,
alt_format: 'm/d/Y',
flatpickr_cleave_date_pattern: %w[m d Y]
}
@joeybeninghove
joeybeninghove / toHaveClass.js
Last active December 16, 2020 03:58
toHaveCssClass custom matcher for jest-dom
expect.extend({
toHaveCssClass(received, cssClass) {
const pass = received.querySelector(`.${cssClass}`) !== undefined;
return {
message: () => this.isNot ? `${cssClass} was found` : `${cssClass} not found`,
pass: pass
};
}
});
@joeybeninghove
joeybeninghove / arrow-blue-400.scss
Created December 10, 2020 16:46
Make select arrow blue using Tailwind CSS
select.arrow-blue-400 {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'
fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23#{str-slice(quote($colors-blue-400), 2, 7)}' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e")
}