Skip to content

Instantly share code, notes, and snippets.

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 24, 2024 11:51
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@BitPhinix
BitPhinix / binding.tsx
Last active April 24, 2024 11:49
yjs react binding
import React, { useMemo, useSyncExternalStore } from "react";
import {
type SharedArray,
type SharedDoc,
type SharedMap,
type SharedType,
type ToJson,
type ToJsonDeep,
} from "./types.ts";
@rysstad
rysstad / Install-MSIPackage.ps1
Last active April 24, 2024 11:49
Install MSI package silently with powershell
$msiPackageToInstall = "<path to .msi>"
# save log from installation to temp file
$tmpFile = [System.IO.Path]::GetTempFileName()
Start-Process msiexec -ArgumentList "/i $msiPackageToInstall /qn /L*v $tmpFile" -NoNewWindow -Wait
@AruniRC
AruniRC / ms_coco_classnames.txt
Created March 5, 2018 20:37
Class Names of MS-COCO classes in order of Detectron dict
{0: u'__background__',
1: u'person',
2: u'bicycle',
3: u'car',
4: u'motorcycle',
5: u'airplane',
6: u'bus',
7: u'train',
8: u'truck',
9: u'boat',
@ddanier
ddanier / fastapi_globals.py
Last active April 24, 2024 11:46
flask.g for FastAPI.
"""
This allows to use global variables inside the FastAPI application using async mode.
# Usage
Just import `g` and then access (set/get) attributes of it:
```python
from your_project.globals import g
@CreatureSurvive
CreatureSurvive / iOS System Colors.md
Created March 21, 2022 21:51
iOS System Colors with their light and dark values

iOS System Colors

Background Colors

Color Name Light Color Dark Color
systemBackground #FFFFFFFF rgba(1.0, 1.0, 1.0, 1.0) #000000FF rgba(0.0, 0.0, 0.0, 1.0)
secondarySystemBackground #F2F2F7FF rgba(0.95, 0.95, 0.97, 1.0) #1C1C1EFF rgba(0.11, 0.11, 0.12, 1.0)
tertiarySystemBackground #F2F2F7FF rgba(0.95, 0.95, 0.97, 1.0) #1C1C1EFF rgba(0.11, 0.11, 0.12, 1.0)
tertiarySystemBackground #FFFFFFFF rgba(1.0, 1.0, 1.0, 1.0) #2C2C2EFF rgba(0.17, 0.17, 0.18, 1.0)
<?php
declare(strict_types=1);
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;
use pocketmine\math\Vector3;
use pocketmine\math\VoxelRayTrace;
use pocketmine\player\Player;
use pocketmine\scheduler\CancelTaskException;
jQuery(document).ready(function($) {
// Start ready block
// if ($.fn.datetimepicker) {
// $('#incident_date_time').datetimepicker({
// format: 'Y-m-d H:i',
// step: 5
// });
// }
@pixelsnafu
pixelsnafu / CloudsResources.md
Last active April 24, 2024 11:45
Useful Resources for Rendering Volumetric Clouds

Volumetric Clouds Resources List

  1. A. Schneider, "Real-Time Volumetric Cloudscapes," in GPU Pro 7: Advanced Rendering Techniques, 2016, pp. 97-127. (Follow up presentations here, and here.)

  2. S. Hillaire, "Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite" in Physically Based Shading in Theory and Practice course, SIGGRAPH 2016. [video] [course notes] [scatter integral shadertoy]

  3. [R. Högfeldt, "Convincing Cloud Rendering – An Implementation of Real-Time Dynamic Volumetric Clouds in Frostbite"](https://odr.chalmers.se/hand

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active April 24, 2024 11:44
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+