Skip to content

Instantly share code, notes, and snippets.

View j0hnm4r5's full-sized avatar

John Mars j0hnm4r5

View GitHub Profile
@j0hnm4r5
j0hnm4r5 / BEGIN.gcode
Last active January 7, 2023 02:17
Start/End GCODE for Wanhao Duplicator i3 Plus / Monoprice Maker Select Plus in Cura
;Sliced at: {day} {date} {time}
;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}
;Print time: {print_time}
;Filament used: {filament_amount}m {filament_weight}g
;Filament cost: {filament_cost}
G21 ;metric values
G90 ;absolute positioning
M117 Heating extruder & bed...
@j0hnm4r5
j0hnm4r5 / machine.js
Last active June 8, 2021 21:16
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'a101',
initial: 'm_1',
states: {
m_1: {
on: {
OKAY: 'm_2',
}
},
m_2: {
@j0hnm4r5
j0hnm4r5 / .zshrc
Last active November 16, 2021 17:49
### ========= POWERLEVEL10K ========= ###
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
### ========= OH MY ZSH ========= ###
# oh-my-zsh installation locations
export ZSH="/Users/mars/.oh-my-zsh"
@j0hnm4r5
j0hnm4r5 / index.js
Created April 20, 2020 17:12
/r/destinythegame Sentiment Analysis
/* eslint-disable no-restricted-syntax */
/* eslint-disable unicorn/consistent-function-scoping */
/* eslint-disable no-await-in-loop */
const axios = require(`axios`);
const language = require(`@google-cloud/language`);
const client = new language.LanguageServiceClient();
const createCsvWriter = require(`csv-writer`).createObjectCsvWriter;
### Keybase proof
I hereby claim:
* I am j0hnm4r5 on github.
* I am j0hnm4r5 (https://keybase.io/j0hnm4r5) on keybase.
* I have a public key ASCUT26V4jC8eOuLTXej0i86mcDj-i995bUw8tUReGNPUgo
To claim this, I am signing this object:
@j0hnm4r5
j0hnm4r5 / package.json
Created March 7, 2019 02:55
Netlify Free Password Protection
{
...,
"scripts": {
"start": "gatsby develop -p 1234 -H 0.0.0.0",
"publish": "npm run _clean && npm run _build && npm run _encrypt && npm run _envDeploy",
"//": "========= PRIVATE SCRIPTS =========",
"_clean": "gatsby clean",
"_build": "gatsby build",
"_encrypt": "npx staticrypt public/index.html P@55W0RD -o public/index.html",
"_deploy": "npx netlify-cli deploy --dir=public --prod",
@j0hnm4r5
j0hnm4r5 / name.c
Last active March 7, 2019 02:28
Teensy Serial Name
#include <usb_names.h>
#define MANUFACTURER_NAME \
{ \
'M', '4', 'R', '5' \
}
#define MANUFACTURER_NAME_LEN 4
#define PRODUCT_NAME \
{ \
@j0hnm4r5
j0hnm4r5 / README.md
Last active October 7, 2018 01:56
Button Presser

Installation

  1. Set up your microcontroller according to the instructions at Johnny-Five
  2. Hook up your servo to pin 9 on the microcontroller
  3. Install all dependencies with npm install
  4. Change the numberOfPresses, pressTime, and releaseTime variables in index.js
  5. Run npm run start to begin pressing your button! You'll probably have to adjust the servo horn and whatever you're holding the servo with.
@j0hnm4r5
j0hnm4r5 / HomebridgePS4.md
Last active April 25, 2022 23:49
Start your PS4 from Apple Home

PS4 On Homebridge

These are instructions to create a series of buttons within the Apple Home app that control PS4 power and open/close any app you want.

  1. Install Node.js

    Begin by installing Node.js if you haven't already. Their website has up-to-date versions and installation instructions for your OS.

    For macOS I use Homebrew to install packages. If you're a developer (or an aspiring one), I highly recommend using it. Via homebrew, installing node is as simple as brew install node.

// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
// ========= COLORS =========
const colors = {
black: "#08040B",
red: "#D42450",
green: "#A9D400",
yellow: "#D95702",