Skip to content

Instantly share code, notes, and snippets.

@dvdhfnr
dvdhfnr / midas_loss.py
Last active December 18, 2025 07:11
Loss function of MiDaS
import torch
import torch.nn as nn
def compute_scale_and_shift(prediction, target, mask):
# system matrix: A = [[a_00, a_01], [a_10, a_11]]
a_00 = torch.sum(mask * prediction * prediction, (1, 2))
a_01 = torch.sum(mask * prediction, (1, 2))
a_11 = torch.sum(mask, (1, 2))
@50percentgrey
50percentgrey / apple.sh
Created January 29, 2020 19:11
Delete-Clean Unnecessary files / Apple / Xcode
#!/bin/bash
# Delete Archived Applications
rm -r ~/Library/Developer/Xcode/Archives/*/
# Delete Devired Data
rm -r ~/Library/Developer/Xcode/DerivedData/*/
# Delete Apple cached files
rm -r ~/Library/Developer/CoreSimulator/Caches/dyld/*/*/
" antirez's .vimrc
" Copyright(C) 2001 Salvatore Sanfilippo
" Enable the syntax highlight mode if available
syntax sync fromstart
if has("syntax")
syntax sync fromstart
syntax on
set background=dark
let php_sync_method="0"
@eooce
eooce / auto-add-ssl-workers.js
Last active December 18, 2025 07:03
auto-add-ssl-workers
export default {
async fetch(request, env, ctx) {
const url = new URL(request.url);
// 处理 API 请求:支持 POST (/api/add-ssl) 和 GET (/?...)
if (
(url.pathname === '/api/add-ssl' && request.method === 'POST') ||
(url.pathname === '/' && request.method === 'GET' && url.searchParams.has('zoneId'))
) {
return handleApiRequest(request, url.searchParams);
// ==UserScript==
// @name B站学习机 | Bilibili+Youtube字幕全文阅读 | coursera-like subtitles fulltext reader
// @namespace https://gist.github.com/KnIfER/9e43ffa31c3b9831a500edf35595c1dc
// @version 6
// @description 在线字幕阅读或下载,B站油管秒变cousera! - Read & learn subtitles full text online!
// @author KnIfER
// @match https://*.bilibili.com/video/*
// @match https://*.youtube.com/*
// @match https://*/watch?v=*
// @match https://*/embed/*?si=*
@TohidEq
TohidEq / gmail_in_doom_emacs.markdown
Last active December 18, 2025 06:59
Setting Up Gmail Account(s) in DOOM Emacs

Gmail in Doom Emacs

A personal note to remember what on earth I did to set up Gmail in Emacs.

example

Read This.

@sile
sile / main.md
Last active December 18, 2025 06:57
2025年の趣味開発環境

2025年の趣味開発環境

2025年は趣味開発環境の変化が大きかったので備忘録として残しておく。

前提:

  • 趣味開発はほぼ毎日している
  • 開発するのはコマンドラインツールやライブラリが多い
  • 言語はほぼRust
  • 開発はほぼAndroid上
@JBlond
JBlond / bash-colors.md
Last active December 18, 2025 06:57 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@allenk
allenk / deepclean.cmd
Last active December 18, 2025 06:57
ASUS Software Clean Up Tool
@echo off
:: ------------------------------------------------------------------------------------------------------------
:: Clean Up ASUS All
:: ------------------------------------------------------------------------------------------------------------
:: The tool helps to clean up all ASUS software from system
:: ------------------------------------------------------------------------------------------------------------
:: Before running the tools,
:: 1. Complete backup your system.
:: 2. Disable ASUS Apps from BIOS (MyASUS and Armoury)
:: 3. Run ASUS remove tools (Armoury Crate Uninstall Tool.exe, or geek_uninstall.exe).
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active December 18, 2025 06:56
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).