Skip to content

Instantly share code, notes, and snippets.

View joeybeninghove's full-sized avatar

Joey Beninghove joeybeninghove

View GitHub Profile
/* 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 / gateways.md
Last active July 5, 2021 09:52
Gateways with supported countries
@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")
}
namespace :code do
task precommit: %i[rubocop erblint csslint jslint jstest rspec]
task :rubocop do
system('rubocop', exception: true)
end
task :erblint do
system('bundle exec erblint --lint-all --enable-all-linters',
exception: true)
class Post
include ActiveModel::Model
YAML_FRONT_MATTER_REGEXP =
%r{\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)}m.freeze
attr_accessor :title, :date, :html, :filename
def slug
File.basename(filename, ".md").remove(filename[0, 11])
@joeybeninghove
joeybeninghove / Styles.js
Created July 24, 2019 18:59
React Native Tailwind-esque Styles
import React from "react";
import { StyleSheet } from "react-native";
import { colors } from "./Colors";
let stylesheet = StyleSheet.create({
"flex-1": { flex: 1 },
"flex-row": { flexDirection: "row" },
"justify-around": { justifyContent: "space-around" },
"justify-between": { justifyContent: "space-between" },
"items-center": { alignItems: "center" },