Skip to content

Instantly share code, notes, and snippets.

View mrchimp's full-sized avatar

Jake mrchimp

View GitHub Profile
@mrchimp
mrchimp / app.ts
Created July 10, 2022 15:36
TypeScript compile error: TS7006: Parameter 'id' implicitly has an 'any' type.
class Foo {
id: string;
constructor(id: string) {
this.id = id;
}
}
@mrchimp
mrchimp / IRController.ino
Created September 26, 2021 20:01
IR Controller
int signal_and_noise, noise_val;
float signal_val, midi_val, constrained_midi_val;
const int IR_LED_PIN = 13;
const int SENSOR_PIN = 17;
const int MIDI_CC = 74;
const int MIDI_CHANNEL = 1;
const float VAL_MIN = 0;
@mrchimp
mrchimp / optional-link.blade.php
Last active August 5, 2021 13:35
Optional Link Blade Component
@mrchimp
mrchimp / HandlesXhrErrors.js
Created July 16, 2021 17:11
XHR Error Handler Vue Mixin
import get from "lodash/get";
export default {
data() {
return {
xhrErrors: [],
xhrMessage: null
};
},
#!/usr/bin/env bash
echo "Composer install..."
./enso composer install
echo "Yarn install..."
./enso yarn install
echo "Publishing assets..."
if [ $2 = "5" ]; then
@mrchimp
mrchimp / ratios.scss
Created August 5, 2019 12:30
Fixed Ratios with SCSS
@function percentage($amount, $total) {
@return ($amount / $total) * 100;
}
@mixin ratio($width, $height) {
position: relative;
&::before {
content: '';
float: left;
@mrchimp
mrchimp / times.sh
Created July 2, 2019 10:48
Get average response time for a given url
#!/usr/bin/env bash
# Usage:
# ./times.sh http://example.com
# Number of requests to make. You can up this if for a more accurate result
n=20
# The URL we will be accessing
url=$1
@mrchimp
mrchimp / footpedal.ino
Created April 1, 2018 00:31
Arduino simple keypress
const int PIN_INT_LED = LED_BUILTIN;
const int PIN_BTN_1 = 6;
int pedal = 0;
int pedal_previous = 0;
void setup() {
pinMode(PIN_BTN_1, INPUT_PULLUP);
pinMode(PIN_INT_LED, OUTPUT);
}
@mrchimp
mrchimp / Linux Setup
Created February 25, 2018 13:50
Linux Setup
sudo apt install php7.0 php7.0-mbstring php7.0-dom
sudo apt install docker docker-compose
######################################################################
https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-repository
######################################################################
# Webmin
@mrchimp
mrchimp / example.html
Created April 25, 2017 12:41
Nice Select
<!-- Based on https://coderwall.com/p/w7npmq/fully-custom-select-box-simple-css-only -->
<div class="select select--nice">
<select>
<option value="example">Example</option>
<option value="example">Example</option>
<option value="example">Example</option>
<option value="example">Example</option>
<option value="example">Example</option>
</select>