Skip to content

Instantly share code, notes, and snippets.

@stefhen
stefhen / du.txt
Created October 26, 2014 17:34
aws cli s3 du
aws s3 ls s3://bucket --recursive | grep -v -E "(Bucket: |Prefix: |LastWriteTime|^$|--)" | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024/1024" GB"}'
@joegasper
joegasper / ConvertTo-SRT.ps1
Last active January 13, 2025 16:33
Convert VTT files to SRT format
<#
.SYNOPSIS
Fast conversion of Microsoft Stream VTT subtitle file to SRT format.
.DESCRIPTION
Uses select-string instead of get-content to improve speed 2 magnitudes.
.PARAMETER Path
Specifies the path to the VTT text file (mandatory).
.PARAMETER OutFile
Specifies the path to the output SRT text file (defaults to input file with .srt).
.EXAMPLE
@Zn4rK
Zn4rK / README.md
Last active January 13, 2025 16:33
pnpm and expo without node-linker=hoisted

I have a pretty big monorepo, and adding node-linker=hoisted to .npmrc would have significant consequences. With the help of rnx-kit, I managed to configure Expo to work without changes to .npmrc.

I haven't encountered any major issues yet, but I also haven't built or released a production version of my app, so we'll see how it goes.

Steps:

  1. Add the following dependencies to your package.json:

{

@PlugFox
PlugFox / shake_detector.dart
Last active January 13, 2025 16:32
ShakeDetector
import 'dart:async';
import 'dart:math' as math;
import 'package:flutter/widgets.dart';
import 'package:sensors_plus/sensors_plus.dart' as sensors show accelerometerEvents;
// ignore: prefer_mixin
class ShakeDetector with ChangeNotifier {
ShakeDetector({
int minShakeCount = 5,
@PhilipSchmid
PhilipSchmid / rke2-node-cleanup.md
Last active January 13, 2025 16:30
RKE2 node cleanup statements to clean up a node after a failed Rancher custom cluster installation try

RKE2 Node Cleanup To reset a RKE2 node, run the following commands:

# rke2-(server|agent) related
rke2-killall.sh
rke2-uninstall.sh
# rancher-system-agent related
systemctl stop rancher-system-agent.service
systemctl disable rancher-system-agent.service
rm -f /etc/systemd/system/rancher-system-agent.service
@DavidM42
DavidM42 / HowTo.md
Created December 31, 2020 00:15
CSS Content Addon in Gmod for Dummies

CSS Content Addon in Gmod for Dummies

  1. Download the zipped addon from mega
  2. Open your file explorer to the Garry's Mod Game in your steam directory
  • Similiar to C:\SteamBib\steamapps\common\GarrysMod\garrysmod\addons
  1. Unzip content of Downloaded zip to this folder
@lhl
lhl / power-usage.py
Created January 13, 2025 05:58
2025-01 vLLM/Llama 3.3 70B FP8 tokens/joule
# Power Usage Calculator for AI Workloads
'''
# Serving
$ vllm serve meta-llama/Llama-3.3-70B-Instruct --tensor-parallel-size 4 --num-scheduler-steps 20 --quantization=fp8 --gpu-memory-utilization=0.97
INFO 01-13 04:59:05 api_server.py:712] vLLM API server version 0.6.6.post2.dev5+g5ce4627a
# Benchmark - we do bs=64 to emulate https://arxiv.org/pdf/2310.03003
cmd = [
"python", os.path.expanduser("~/vllm/benchmarks/benchmark_serving.py"),
@turicas
turicas / Transcrição de textos em Português com whisper (OpenAI).ipynb
Last active January 13, 2025 16:26
Transcrição de textos em Português com whisper (OpenAI)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jh3y
jh3y / gsap-eases.css
Last active January 13, 2025 16:24
GreenSock eases with CSS linear()
:root {
--none: linear(0, 1);
--power1-in: linear( 0, 0.0039, 0.0156, 0.0352, 0.0625, 0.0977, 0.1407, 0.1914, 0.2499, 0.3164, 0.3906 62.5%, 0.5625, 0.7656, 1 );
--power1-out: linear( 0, 0.2342, 0.4374, 0.6093 37.49%, 0.6835, 0.7499, 0.8086, 0.8593, 0.9023, 0.9375, 0.9648, 0.9844, 0.9961, 1 );
--power1-in-out: linear( 0, 0.0027, 0.0106 7.29%, 0.0425, 0.0957, 0.1701 29.16%, 0.2477, 0.3401 41.23%, 0.5982 55.18%, 0.7044 61.56%, 0.7987, 0.875 75%, 0.9297, 0.9687, 0.9922, 1 );
--power2-in: linear( 0, 0.0014 11.11%, 0.0071 19.24%, 0.0188 26.6%, 0.037 33.33%, 0.0634 39.87%, 0.0978 46.07%, 0.1407 52.02%, 0.1925 57.74%, 0.2559 63.49%, 0.3295 69.07%, 0.4135 74.5%, 0.5083 79.81%, 0.6141 85%, 0.7312 90.09%, 1 );
--power2-out: linear( 0, 0.2688 9.91%, 0.3859 15%, 0.4917 20.19%, 0.5865 25.5%, 0.6705 30.93%, 0.7441 36.51%, 0.8075 42.26%, 0.8593 47.98%, 0.9022 53.93%, 0.9366 60.13%, 0.963 66.67%, 0.9812 73.4%, 0.9929 80.76%, 0.9986 88.89%, 1 );
--power2-in-out: linear( 0, 0.0036 9.62%, 0.0185 16.66
@lelandbatey
lelandbatey / stardew_animation_cancel.ahk
Created December 21, 2021 19:34
An autohotkey script for animation-canceling while playing Stardew valley.
; Stardew Valley animation cancel script
; Original from this post:
; https://forums.stardewvalley.net/threads/a-better-animation-canceling-autohotkey-script.7391/
; This version has been modified to be slightly more explicit about things like
; making sure that the Keyboard Hooks are in use.
; WARNING: make sure that the "Check/Do Action" control within the options of
; Stardew Valley is bound to a *DIFFERENT* key than the key that this script uses
; to trigger the animation canceling. If you have this script bound to the same
; key as the "Check/Do Action" key in-game, you'll face issues where holding down