Skip to content

Instantly share code, notes, and snippets.

View devbyray's full-sized avatar
:octocat:
Building cool things!

Dev By Ray devbyray

:octocat:
Building cool things!
View GitHub Profile
base_width = 50;
base_length = 30;
base_height = 10;
border_size = 2;
$fn = 50;
difference() {
// Main bucket
minkowski() {
//Parameters
name = "RayRay";
name_size = 10;
name_height = 1;
font = "Lobster Two";
outline_height = 1;
outline_thickness = 1.6;
// This takes care of smoother edges
$fn = 50;
@devbyray
devbyray / gist:eb9741529685e29ecaa1543321510620
Created May 27, 2024 05:46
OpenSCAD Name Tag Generator + Customizer
name = "Anne-marie";
extra_length = -10;
function getFrameWidth() = (len(name) * (len(name) > 10 ? 8 : 10)) + extra_length;
translate([0, -4, 0])
linear_extrude(height=5)
text(name);
@media (prefers-color-scheme: dark) {
:root {
--txtPrimaryColor: #fff;
--txtHintColor: #666f75;
--txtDisabledColor: #a0a6ac;
--primaryColor: rgb(46, 46, 59);
--bodyColor: #081022;
@devbyray
devbyray / elfproef.validation.js
Last active February 22, 2024 12:07
How to validate BSN, PGN & OWN in the Netherlands with TypeScript/JavaScript
function elfProefValidation(value, type) {
let returnValue = false;
if (!value || value?.length === 0) {
return true;
}
if (value === '00000000000' || value.length !== 9) {
return false;
}
const values = value.split('');
const firstCharacter = parseInt(values[0], 10);
@devbyray
devbyray / docReady-promise.ts
Created December 13, 2023 07:57
Document Ready with a Promise in TypeScript
export function docReady(): Promise<void> {
return new Promise((resolve) => {
if (document.readyState === 'interactive') {
resolve()
} else {
window.addEventListener('DOMContentLoaded', () => {
resolve()
})
}
})
@devbyray
devbyray / domIsReady.js
Last active November 13, 2023 17:46
Vanilla JavaScript Document Ready (Cross-Browser)
var domIsReady = (function(domIsReady) {
var isBrowserIeOrNot = function() {
return (!document.attachEvent || typeof document.attachEvent === "undefined" ? 'not-ie' : 'ie');
}
domIsReady = function(callback) {
if(callback && typeof callback === 'function'){
if(isBrowserIeOrNot() !== 'ie') {
document.addEventListener("DOMContentLoaded", function() {
return callback();
@devbyray
devbyray / pull_request_template.md
Last active October 11, 2023 07:44
PR template example for Azure DevOps. Put this file in the folder ".azuredevops".
  • The pull request title and description are clear and concise, and follow the project’s pull request template.
  • The code changes are relevant to the user story or task, and do not introduce any unrelated changes or dependencies.
  • The code follows the Vue style guide1 and the project’s coding standards, and does not contain any errors, warnings, or console logs.
  • The code is tested and passes all unit tests and end-to-end tests, and has a test coverage of at least 80%.
  • The code is documented with comments and JSDoc annotations, and has no spelling or grammar mistakes.
  • The code is linted and formatted with Prettier or ESLint, and has no conflicts with the main branch.
  • The code is compatible with all major browsers and devices, and has no accessibility issues.
  • The code uses Strapi as the backend, and communicates with it using Apollo GraphQL client.
  • The code implements Nuxt features such as SSR, static generation, routing, meta tags, etc., where applicable.
  • [ ]
@devbyray
devbyray / custom-instruction.md
Created September 29, 2023 08:30
Turn ChatGPT to AutoGPT with Custom Instructions

Act as Professor Synapse🧙🏾‍♂️, a conductor of expert agents. Your job is to support the user in accomplishing their goals by aligning with their goals and preference, then calling upon an expert agent perfectly suited to the task by initializing "Synapse_COR" = "${emoji}: I am an expert in ${role}. I know ${context}. I will reason step-by-step to determine the best course of action to achieve ${goal}. I can use ${tools} to help in this process

I will help you accomplish your goal by following these steps: ${reasoned steps}

My task ends when ${completion}.

${first step, question}."

Follow these steps:

@devbyray
devbyray / chatgpt-template-filled-trip-planner-SF.md
Created September 20, 2023 06:58
Personalised Trip Itinerary Planning Template
You are a great travelagent and specialised in planning trips in all kinds of locations. I want you to plan my trip based on all the information below. Use the timetable as a template for each day, so I have a detailed description for each day of the trip.

## General Information
1. **Travel Dates**: October 16th - October 19th
2. **Number of People**: 2
3. **Destination**: San Francisco, CA
4. **Accommodation**: Union Square area
5. **Budget Constraints**: None specified
6. **Preferred Mode of Transportation**: Car rental