Skip to content

Instantly share code, notes, and snippets.

View jpfaraco's full-sized avatar

João Faraco jpfaraco

View GitHub Profile
@jpfaraco
jpfaraco / sine-ring.txt
Created February 20, 2026 17:55
Onshape feature - Sine ring
FeatureScript 2780;
import(path : "onshape/std/common.fs", version : "2780.0");
annotation { "Feature Type Name" : "Sine Wave Ring" }
export const sineWaveRing = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
annotation { "Name" : "Plane", "Filter" : EntityType.FACE || BodyType.MATE_CONNECTOR, "MaxNumberOfPicks" : 1 }
definition.plane is Query;
@jpfaraco
jpfaraco / sine-wave.txt
Last active February 20, 2026 17:40
Onshape feature - Sine wave
FeatureScript 2780;
import(path : "onshape/std/common.fs", version : "2780.0");
annotation { "Feature Type Name" : "Sine wave" }
export const sineWave = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
annotation { "Name" : "Edge", "Filter" : EntityType.EDGE, "MaxNumberOfPicks" : 1 }
definition.edge is Query;
@jpfaraco
jpfaraco / ColorFunctions.js
Created January 10, 2022 05:31
Functions to convert color formats.
function RGBtoHSV(r, g, b) {
if (arguments.length === 1) {
g = r.g, b = r.b, r = r.r;
}
var max = Math.max(r, g, b), min = Math.min(r, g, b),
d = max - min,
h,
s = (max === 0 ? 0 : d / max),
v = max / 255;
{
"name": "Hospitalk",
"short_name": "Hospitalk",
"theme_color": "#91aacb",
"background_color": "#91AACB",
"display": "fullscreen",
"Scope": "/",
"start_url": "/",
"icons": [
{
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@jpfaraco
jpfaraco / manifest.json
Created August 8, 2017 22:59
Web App Manifest
{
"name": "Web App",
"icons": [
{
"src": "launcher-icon-0-75x.png",
"sizes": "36x36",
"type": "image/png"
},
{
"src": "launcher-icon-1x.png",
Verifying my Blockstack ID is secured with the address 1FqL5fzzGr5SgkjcHgRWAsC4RDy5SJqZEg https://explorer.blockstack.org/address/1FqL5fzzGr5SgkjcHgRWAsC4RDy5SJqZEg
Verifying that "jpfaraco.id" is my Blockstack ID. https://explorer.blockstack.org/name/jpfaraco.id
@jpfaraco
jpfaraco / _.md
Last active April 29, 2017 17:46
HCL Gradient
@jpfaraco
jpfaraco / _.md
Last active April 29, 2017 17:48
Simple canvas particles