Skip to content

Instantly share code, notes, and snippets.

View SharpCoder's full-sized avatar
🛰️
inventing

Josh Cole SharpCoder

🛰️
inventing
View GitHub Profile
@SharpCoder
SharpCoder / app.jsx
Last active September 27, 2019 06:46
import React, { PureComponent, useState } from 'react';
import SlideNavigator from './slider/slideNavigator';
const MyView = ({ className, navigateTo }) => {
return (<h1 style={{backgroundColor: "blue"}} className={className} onClick={() => { navigateTo("view2")} }>Hello, world!</h1>);
};
const MyOtherView = ({ className, navigateBack, navigateTo }) => {
const [navs, setNavs] = useState(0);
module circular_mirror(x=0, y=0, d, steps) {
aps = 360 / steps;
for (step=[0:steps]) {
current_angle = step * aps;
unit_x = cos(current_angle);
unit_y = sin(current_angle);
translate([x, y, 0]) {
translate([unit_x * d, unit_y * d, 0]) {
rotate(current_angle) children();
}
include <openfusion.scad>
// Personal Constants
in_to_mm = 25.4;
tol = .2;
/* Bore */ bore = 45 + tol; // mm
/* Height */ h = 5; // mm
/* Number of teeth */ N = 32;
/* Diametrical pitch */ P = 12;
function parametric_points(fx, fy, t0=0, t1=10, delta=0.01)
= [for(i = [t0:delta:t1]) [fx(i), fy(i)]];
function reverse(vector)
= [for(i = [1:len(vector)]) vector[len(vector) - i]];
x = function(t) t;
y = function(t) -2 * pow(t, 2) + 2;
y2 = function(t) y(t) + .25;
@SharpCoder
SharpCoder / _Gear Generator README.md
Last active December 5, 2024 15:15
Gear generation code with openSCAD

gears.scad

In order to use this code, you will need to copy gears.scad to your Libraries folder. https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Libraries

And then you can run Untitled.scad as any other normal scad project file.

If you don't want to mess around with the library, just combine the two code files together into one.

Library Functions

@SharpCoder
SharpCoder / sigilpack.cpp
Created February 2, 2020 21:19
Hexagon Sigil Arduino Code
#include <Adafruit_NeoPixel.h>
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1:
#define LED_PIN 7
// How many NeoPixels are attached to the Arduino?
#define LED_COUNT 2
// Declare our NeoPixel strip object:
include <openfusion.scad>
include <gears.scad>
//
bolt_bore = 6.2;
bearing_bore = 19.1 + 3.2;
limb_height = 6;
bearing_padding = 0;
@SharpCoder
SharpCoder / README.md
Last active April 3, 2020 20:53
Contributing Guidelines - for Makers

Contributing Guidelines

Hello! We're so glad you are interested in producing components for the extraordinarily in-demand PPE face shields which our local hospitals desperately need. To help facilitate this endeavor, we've created these guidelines to help make the process clear and simple.

What to make

Any and all components are currently in-demand. So feel free to make whichever one you are comfortable and setup to create. At this time, we are okay with accepting just shields, or just frames, or both.

3D Printed File

Once you're ready to go, feel free to start 3D printing or cutting the acrylic parts. We are standardizing on a single model, to help with the logistics of sourcing all the necessary components.

# Install mtrack driver 0.5.0++
# Save this file to /usr/share/X11/xorg.conf.d/50-mtrack.conf
# This config is specialized for MacBook Air 2012 (5,2)
Section "InputClass"
MatchIsTouchpad "on"
Identifier "Touchpads"
MatchDevicePath "/dev/input/event*"
Driver "mtrack"
# The faster you move, the more distance pointer will travel, using "polynomial" profile
Option "AccelerationProfile" "2"
@SharpCoder
SharpCoder / cache.rs
Last active September 29, 2020 05:27
use std::fs;
use std::path::Path;
pub trait Cache {
fn write_file(&self, bucket: String, path: String, contents: String);
fn write_json<Z : serde::ser::Serialize >(&self, bucket: String, path: String, model: Z);
fn read_file(&self, bucket: String, path: String) -> Option<Vec<u8>>;
fn read_json<Z : serde::de::DeserializeOwned>(&self, bucket: String, path: String) -> Option<Z>;
}