Skip to content

Instantly share code, notes, and snippets.

@m-ahmadi
m-ahmadi / all-technical-indicators.md
Last active May 15, 2024 18:44
A List of All Technical Indicators
@noqqe
noqqe / bitcoin.sh
Created June 4, 2011 10:32
Bitcoin Mining Script for Debian
#!/bin/bash
### BEGIN INIT INFO
# Provides: BitCoinMining
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: false
# Short-Description: Start/stop BitCoing Mining poclbm-mod
### END INIT INFO
@jasco
jasco / DialogFragAnim_snippet.java
Created October 5, 2014 00:26
DialogFragment enter/exit animations
// example courtesy of http://adilatwork.blogspot.com/2012/11/android-dialogfragment-enter-and-exit.html
// file location: src/main/java/com/example/
@Override
public void onStart() {
super.onStart();
// safety check
if (getDialog() == null) {
return;
@Kooshaba
Kooshaba / frenzy.js
Created August 3, 2023 10:58
Sky Strife Frenzy Plugin
const {
network: {
match,
},
utils: {
isOwnedByCurrentPlayer,
manhattan,
},
} = networkLayer;
@tbuyle
tbuyle / html_template_controller.js
Last active May 15, 2024 18:32
Load external HTML template and append them to the document body (Stimulus.js)
import { Controller } from "stimulus"
export default class extends Controller {
connect() {
const templates = this.element.import.querySelectorAll("template");
templates.forEach(function(template) {
document.querySelector('body').appendChild(template);
});
}
}
@darkuncle
darkuncle / The_Rules.md
Last active May 15, 2024 18:32
The Rules - guidelines learned through hard experience in operations

(subject to additions, but rarely changes)

rule 0: It has to work.

rule 1: As simple as possible.

rule 2: Use the right tool for the job.

rule 3: Everything is a tradeoff. (see Rule 41)

@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@gagarine
gagarine / win11-mouse-scroll-reverse.md
Last active May 15, 2024 18:30
Reverse Mouse Wheel scroll in Windows 11 (Natural Mode like MacOS)

Reverse Mouse Wheel scroll in Windows 11

Chose between natural mode like MacOS or Windows default mode.

Step 1: Open Windows PowerShell in Administrator Mode.

You can do this by going to Start Menu, type PowerShell, and click Run as Administrator.

Step 2: Copy the following code and paste it in the command line of Windows PowerShell:

$mode = Read-host "How do you like your mouse scroll (0 or 1)?"; Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object { "$($_.Name): $($_.DeviceID)"; Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name FlipFlopWheel -Value $mode; "+--- Value of FlipFlopWheel is set to " + (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters").FlipFlopWheel + "`n" }
@lucakiebel
lucakiebel / mongodump_in_docker-compose.sh
Last active May 15, 2024 18:28
Use Mongodump and Mongorestore to backup and restore MongoDB Databases run in docker-compose
docker-compose exec -T mongodb mongodump --authenticationDatabase admin -u root -p password --db test --archive --gzip > dump.gz
@protrolium
protrolium / ffmpeg.md
Last active May 15, 2024 18:27
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: