Skip to content

Instantly share code, notes, and snippets.

@EmilienDupont
EmilienDupont / LICENSE
Last active March 29, 2024 08:21
Optimization Algorithms Visualization
The MIT License (MIT)
Copyright (c) 2016 Emilien Dupont
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:
@OrionReed
OrionReed / DOM3D.js
Last active March 29, 2024 08:20
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@ceving
ceving / Web Component for Copyright Years.md
Last active March 29, 2024 08:19
Web Component for Copyright Years
@gsopu8065
gsopu8065 / hog_dlib.py
Created July 17, 2020 17:14
HOG_DLIB
import dlib
import cv2
#step1: read the image
image = cv2.imread("./testimages/test1.jpg")
#step2: converts to gray image
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
#step3: get HOG face detector and faces
@Valeour
Valeour / GradientHDRAttribute.cs
Last active March 29, 2024 08:14
Unity C# Attribute to enable HDR Gradient fields in the Inspector.
/**
* GradientHDRAttribute created by Chance Millar at Two Tails Games on 2018/05/08
* Use freely. That's a license, right?
*
* Attach attribute like so:
*
* [GradientHDR]
* public Gradient _HDRGradient;
*
* Make sure this is placed in a non-Editor folder inside Assets.
@danielcshn
danielcshn / fix-duplicate-class-android-studio.md
Created April 16, 2023 04:08
Fix Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-* Android Studio | 2022.2.1

📜 Info:

  • Android Studio Flamingo | 2022.2.1
  • Build #AI-222.4459.24.2221.9862592, built on March 31, 2023
  • Gradle JDK: jbr-17 (JetBrains Runtime version 17.0.6)
  • Windows 11 (version 10.0.22000.1817)

🐛 Bug/Error log:

@padeoe
padeoe / README_hfd.md
Last active March 29, 2024 08:12
CLI-Tool for download Huggingface models and datasets with aria2/wget+git

🤗Huggingface Model Downloader

Considering the lack of multi-threaded download support in the official huggingface-cli, and the inadequate error handling in hf_transfer, this command-line tool smartly utilizes wget or aria2 for LFS files and git clone for the rest.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
  • 🚀 Multi-threaded Download: Utilize multiple threads to speed up the download process.
  • 🚫 File Exclusion: Use --exclude or --include to skip or specify files, save time for models with duplicate formats (e.g., *.bin or *.safetensors).
  • 🔐 Auth Support: For gated models that require Huggingface login, use --hf_username and --hf_token to authenticate.
  • 🪞 Mirror Site Support: Set up with HF_ENDPOINT environment variable.
@elasticdog
elasticdog / vault-cp
Created July 27, 2018 18:32
A script to copy Vault secrets from one path to another
#!/usr/bin/env bash
# ensure we were given two command line arguments
if [[ $# -ne 2 ]]; then
echo 'usage: vault-cp SOURCE DEST' >&2
exit 1
fi
source=$1
dest=$2
@gmh5225
gmh5225 / createprocess.cpp
Created February 17, 2024 10:09 — forked from senko37/createprocess.cpp
Create process from KernelMode via APC
typedef struct _STARTUPINFOW {
UINT32 cb;
LPWSTR lpReserved;
LPWSTR lpDesktop;
LPWSTR lpTitle;
UINT32 dwX;
UINT32 dwY;
UINT32 dwXSize;
UINT32 dwYSize;
UINT32 dwXCountChars;