Skip to content

Instantly share code, notes, and snippets.

@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@cjddmut
cjddmut / EasingFunctions.cs
Last active May 2, 2024 12:04
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* 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
@protrolium
protrolium / ffmpeg.md
Last active May 2, 2024 12:02
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@ott3rly
ott3rly / nmap-xml-to-httpx.sh
Created February 20, 2024 09:50
Convert nmap xml output suitable for httpx
#!/bin/bash
# Check if an argument was provided
if [ $# -eq 0 ]; then
NMAP_XML_OUTPUT="/dev/stdin"
else
NMAP_XML_OUTPUT="$1"
fi
# Use xmllint to parse IP addresses and ports from the Nmap XML output
@jadia
jadia / malloc_calloc_memset.md
Created October 19, 2018 13:30
How Malloc+memset and calloc works

The short version:

Always use calloc() instead of malloc()+memset(). In most cases, they will be the same. In some cases, calloc() will do less work because it can skip memset() entirely. In other cases, calloc() can even cheat and not allocate any memory! However, malloc()+memset() will always do the full amount of work.

Understanding this requires a short tour of the memory system.

Quick tour of memory

There are four main parts here: your program, the standard library, the kernel, and the page tables. You already know your program, so...

Memory allocators like malloc() and calloc() are mostly there to take small allocations (anything from 1 byte to 100s of KB) and group them into larger pools of memory. For example, if you allocate 16 bytes, malloc() will first try to get 16 bytes out of one of its pools, and then ask for more memory from the kernel when the pool runs dry. However, since the program you're asking about is allocating for a large amount of memory at once, `mal

@davialexandre
davialexandre / gruvbox_dark.json
Created June 23, 2019 18:09
Gruvbox Dark color scheme for the new Windows Terminal
{
"background" : "#282828",
"black" : "#282828",
"blue" : "#458588",
"brightBlack" : "#928374",
"brightBlue" : "#83A598",
"brightCyan" : "#8EC07C",
"brightGreen" : "#B8BB26",
"brightPurple" : "#D3869B",
"brightRed" : "#FB4934",
@careyi3
careyi3 / README.md
Last active May 2, 2024 11:59
Arduino PID Implementation

Arduino PID

This is a basic implementation of a PID controller on an Arduino.

system_diagram

To replicate this, wire up the system as shown below:

system_diagram

@muhdiboy
muhdiboy / lastfm-automated-remove-duplicates.md
Last active May 2, 2024 11:59
LastFM automated duplicate scrobble deletion script

Why would I need this?

Your scrobbler might have decided to scrobble every song hundreds of times, and you can't really remove those scrobbles efficiently. Or you might have accidentally installed multiple scrobbler extensions at the same time - wondering why multiple scrobbles appear for every song played at a time - and you want to clear them after finding the issue.

Using this script still doesn't necessarily make the process quick since Last.fm only displays a limited number of scrobbles that can be removed on each page of your library. However unlike the implementation of @sk22 and its forks, this UserScript, which is derived from those scripts, is run once. The rest of the process is automated and the script will stop at the page you have set using the prompt.

Installation

Prerequisites

@goll
goll / README.md
Last active May 2, 2024 11:59
Docker nftables configuration for Debian 10