Skip to content

Instantly share code, notes, and snippets.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 27, 2024 13:29
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@tomfun
tomfun / plural.js
Created August 23, 2016 12:31
JavaScript russian plural function
function getNoun(number, one, two, five) {
let n = Math.abs(number);
n %= 100;
if (n >= 5 && n <= 20) {
return five;
}
n %= 10;
if (n === 1) {
return one;
}
@vishal2376
vishal2376 / FlipAnimation.kt
Created April 25, 2024 17:16
Card Flip Animation using Jetpack Compose
package com.vishal2376.animations.ui.theme
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.EaseInOut
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
@james-priest
james-priest / GitHub-Fork.md
Last active April 27, 2024 13:23
GitHub Fork & Pull Request Workflow

Fork & Pull Request Workflow

Also know as Fork-and-Branch Workflow

Uses three repos:

  • Original repository (remote) - An open source repo on GitHub
  • Forked repository (remote) - my forked copy of the open source repo on Github
  • Cloned (local) repository (from Forked) - my local copy of my forked repo
@boaglio
boaglio / atalhos-ij.md
Last active April 27, 2024 13:22
Atalhos do IntelliJ - para quem veio do Eclipse

Atalhos do IntelliJ

Principais

Caiu no IntelliJ agora?

Aprenda só esses:

Tipo de Atalho IntelliJ IDEA
@Hansimov
Hansimov / sync-github-repo-to-huggingface-space.md
Last active April 27, 2024 13:22
Sync Github repo to Huggingface space

Push Github Repo to Huggingface Space

Create a huggingface token

Put it in the repo secrets with name like HF_TOKEN in related Github repo setitngs:

Run following commands in the git root folder:

@superjax
superjax / occupancy_grid_mapping_example.py
Last active April 27, 2024 13:18
An occupancy grid mapping example
# This is an implementation of Occupancy Grid Mapping as Presented
# in Chapter 9 of "Probabilistic Robotics" By Sebastian Thrun et al.
# In particular, this is an implementation of Table 9.1 and 9.2
import scipy.io
import scipy.stats
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
local SECS = 5;
local function Min(x, y) {
if (x < y)
return x;
return y;
}
local function Max(x, y) {
if (x > y)
return x;
@SinclairCoder
SinclairCoder / README_hfd.md
Created November 11, 2023 12:02 — forked from padeoe/README_hfd.md
Command-line Tool for Easy Downloading of Huggingface Models

🤗Huggingface Model Downloader

Update: The previous version has a bug. When resuming from a breakpoint, there may be an issue causing incomplete files. Please update to the latest version!!!

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 to skip specific files, save time for models with duplicate formats (e.g., .bin and .safetensors).
  • 🔐 Auth Support: For gated models that require Huggingface login, use --hf_username and --hf_token to authenticate.