Skip to content

Instantly share code, notes, and snippets.

@IrvingArmenta
IrvingArmenta / forwardref-generics-18.ts
Created October 2, 2022 02:50
Example of a forward ref generic component in React 18
import React, { ForwardedRef, forwardRef, MouseEvent } from 'react';
type ClickableListProps<T> = {
items: T[];
onSelect: (
item: T,
event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>,
) => void;
};
@antifuchs
antifuchs / dock.nix
Last active April 30, 2024 08:12
A nix module that arranges the macOS dock the way you want it. Note: It won't allow you to manually re-arrange the items on it; the dock gets reset everytime you log in.
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.local.dock;
stdenv = pkgs.stdenv;
in
{
options = {
local.dock.enable = mkOption {
description = "Enable dock";
@poochin
poochin / gist:1423262
Created December 2, 2011 13:35
sl コマンドに京急AAを追加するパッチです
diff -c sl/sl.c sl_kq/sl.c
*** sl/sl.c 1998-07-22 23:01:01.000000000 +0900
--- sl_kq/sl.c 2011-12-02 21:34:09.540165908 +0900
***************
*** 33,73 ****
#include "sl.h"
int ACCIDENT = 0;
int LOGO = 0;
int FLY = 0;
@warEnd237
warEnd237 / hello.c
Last active April 30, 2024 08:09
mon hello world
int main()
{
printf("hello world");
return 0;
}
@rlingineni
rlingineni / cavasHelper.ts
Created February 4, 2020 02:10
Aligning Guidelines with Fabric.js + Typescript. This is a modifed version of the code here: https://github.com/fabricjs/fabric.js/blob/master/lib/aligning_guidelines.js
import { fabric } from "fabric";
import { ILineOptions } from "fabric/fabric-impl";
/**
* Should objects be aligned by a bounding box?
* [Bug] Scaled objects sometimes can not be aligned by edges
*
*/
@aidos-dev
aidos-dev / README.md
Last active April 30, 2024 08:05
How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

Step 1.

Open your terminal.

In the root directory run the command:

sudo nano /etc/bluetooth/main.conf
@mstevenson
mstevenson / ConfigurableJointExtensions.cs
Last active April 30, 2024 08:05
Unity extension methods for computing a ConfigurableJoint.TargetRotation value from a given local or world rotation.
using UnityEngine;
public static class ConfigurableJointExtensions {
/// <summary>
/// Sets a joint's targetRotation to match a given local rotation.
/// The joint transform's local rotation must be cached on Start and passed into this method.
/// </summary>
public static void SetTargetRotationLocal (this ConfigurableJoint joint, Quaternion targetLocalRotation, Quaternion startLocalRotation)
{
if (joint.configuredInWorldSpace) {
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@qoomon
qoomon / conventional_commit_messages.md
Last active April 30, 2024 08:03
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@meloonics
meloonics / example.md
Last active April 30, 2024 08:03
Obsidian CSS: Stylable Image containers with captions, made from Callouts

image-paths are obviously broken on this one, you can replace the links with images of your own.

[!fig|left|snail]- ![[snail.png|Snail Facts!|200]] Snails are cool! Click to learn more!

  • Snails r cute :3
  • They be eating leaf
  • Swirly soft-boi chomkers :3333

Read-more [[Le Smail Manifesto|here]]!

[!fig|right|px] ![[meloonics_64.png|64]] It me!