Skip to content

Instantly share code, notes, and snippets.

@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!

@SunMarc
SunMarc / finetune_llama_gptq.py
Last active April 30, 2024 08:01
Finetune GPTQ model with peft and tlr
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
Una de las dificultades que encuentran aquellos que se adentran al mundo del NoSQL es al tratar de transformar su esquema de base de datos relacional para que funcione de la mejor manera segun el enfoque NoSQL orientado a documentos, como lo es MongoDB. Aquí aprenderemos sobre como realizar correctamente el modelado de datos para que puedas comenzar a pensar en migrar tus proyectos a este tipo de base de datos con la menor dificultad posible.
* * *
## Tipos de Datos
Al comienzo de la serie explicamos que los documentos de MongoDB son como objetos JSON, para ser especificos son de tipo BSON (JSON Binario), esta estrategia permite la serialización de documentos tipo JSON codificados binariamente. Veamos algunos de los tipos de datos que soporta:
* `String` - Cadenas de caracteres.
* `Integer` - Números enteros.
@ccraig
ccraig / ccc.sh
Last active April 30, 2024 07:57
My current rsync script for cloning my HD ( OS X 10.8 ). The rsync flags are what Carbon Copy Cloner uses.
#!/bin/bash
target_drive=/Volumes/Clone
if [ -d $target_drive ]; then
echo "Last backup: " `cat ~/.last_backup`
sudo echo "And we're off!"
echo "Started: " `date`
echo `date` > ~/.last_backup
sudo time nice -n19 rsync -A -X -H -go --numeric-ids -D --protect-decmpfs -l -rtpx -N --fileflags --force-change --protect-args --delete-before --ignore-errors --filter='._/Users/i/.rsync-filter' // ${target_drive}; bless -folder ${target_drive}/System/Library/CoreServices
else
echo "${target_drive} is not mounted"
@pjobson
pjobson / makemkvcon_cli.md
Last active April 30, 2024 07:56
Make MKV Command Line Examples (makemkvcon)

https://www.makemkv.com/

https://www.makemkv.com/developers/usage.txt

Note: I'm not sure how well this works / doesn't work in Windows, I have little experience messing with it. If you are not very familiar with Linux, . refers to the current path, you could also specify a path like ~/Videos for your Videos path in your home directory.

ISO to MKV

makemkvcon mkv iso:./movie.iso all .