Skip to content

Instantly share code, notes, and snippets.

@khaosdoctor
khaosdoctor / workingwithlucas-en-us.md
Last active May 4, 2024 21:44
Useful info when working with me

Working with Lucas

Creation Date: June 2020

Status: in progress

A collection of stuff that might come in handy when working with me

My personal philosophy:

@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active May 4, 2024 21:41
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@robinknowles
robinknowles / building-an-open-source-mesh-wrapper.md
Created May 18, 2023 13:19
Building triangle_alpha_wrap from the CGAL examples

Shrink-wrapping triangle meshes using CGAL

Accompanies OnCFD Newsletter #147: "It's a(n open-source) wrap"

Here are my "high-level" notes on building a command-line, mesh shrinkwrapper using Alpha Wrap 3 from CGAL.

I did this in an Ubuntu container on a Mac, but you could do similar in Windows Subsystem for Linux or native Ubuntu (or anywhere else that you can grab all of the dependecies).

See the accompanying article for more background 👋

@arkatsy
arkatsy / zustand-internals.jsx
Last active May 4, 2024 21:35
How zustand works internally
import { useSyncExternalStore } from "react";
// For more on the useSyncExternalStore hook, see https://react.dev/reference/react/useSyncExternalStore
// The code is almost identical to the source code of zustand, without types and some features stripped out.
// Check the links to see the references in the source code.
// The links are referencing the v5 of the library. If you plan on reading the source code yourself v5 is the best way to start.
// The current v4 version contains lot of deprecated code and extra stuff that makes it hard to reason about if you're new to this.
// https://github.com/pmndrs/zustand/blob/fe47d3e6c6671dbfb9856fda52cb5a3a855d97a6/src/vanilla.ts#L57-L94
function createStore(createState) {
@WebDevSimplified
WebDevSimplified / bootstrap-breakpoint.css
Last active May 4, 2024 21:33
This stylesheet adds text describing the current Bootstrap Breakpoint in the top right corner of the screen.
body {
margin-top: 40px; /* This margin just makes the text easier to read. You can remove it if you want since it can mess with your other styles. */
}
body::before {
content: "XS";
color: red;
font-size: 2rem;
font-weight: bold;
position: fixed;
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 4, 2024 21:33
A badass list of frontend development resources I collected over time.
@wojteklu
wojteklu / clean_code.md
Last active May 4, 2024 21:33
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

// Zero-Clause BSD (more permissive than MIT, doesn't require copyright notice)
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
// OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
@b01
b01 / download-vs-code-server.sh
Last active May 4, 2024 21:41
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
#!/bin/sh
# Copyright 2023 Khalifah K. Shabazz
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the “Software”),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
@kuc-arc-f
kuc-arc-f / app.js
Created January 18, 2022 02:31
Serverless Framework express, prisma (mysql) sample
const serverless = require('serverless-http');
const express = require('express');
const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users');
const app = express();
app.use('/', indexRouter);
app.use('/users',usersRouter);
module.exports = app;