Skip to content

Instantly share code, notes, and snippets.

View codsane's full-sized avatar

codsane codsane

View GitHub Profile
@iwill
iwill / semverCompare.js
Last active January 19, 2024 12:42
JavaScript - Comparison of Semantic Versioning
/**
* Semantic Versioning Comparing
* #see https://semver.org/
* #see https://stackoverflow.com/a/65687141/456536
* #see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options
*/
function semverCompare(a, b) {
if (a.startsWith(b + "-")) return -1
if (b.startsWith(a + "-")) return 1
return a.localeCompare(b, undefined, { numeric: true, sensitivity: "case", caseFirst: "upper" })
@lucanello
lucanello / rclone_backup.py
Last active March 13, 2024 21:12
Python Rclone Script with Telegram and InfluxDB Reporting
# Python Rclone Script with Telegram and InfluxDB Reporting
# - This Script backups your data to any rclone location (see rclone.org)
# - You can execute scripts, commands and database dumps before running a single rclone command
# - It sends automatic error reports and summaries
# - It saves all statistics and operations to an Influx database
# - The data can be used for visualizations in e.g. Grafana
# - You can automate it by using cron
# Created by: Luca Koroll - https://github.com/lucanello
# Last update: 2021-07-04

Paid Tweak Guidelines (Work-in-Progress)

Asking for payment is equivalent to stating "I have made something truly worth paying for". For example, it is groundbreaking or an incredibly useful addition to iOS. In most cases, consider not asking for payment and look towards open-sourcing your work. The 'soul' of making tweaks is to build something for the fun of it, not to run a business.

If you decide to release a paid tweak, it is not a matter of adding a price to your work and putting it on a default repository. You need to ensure the price is justified, and that the tweak matches customer expectations. After that, you also need to provide support and updates when necessary. To be clear: accepting payments means you become liable for handling a lot more than just writing code.

The following guidelines should be used to check that you are within customer expectations. Please note that individual repositories may also add their own expectations if you decide to release through them (e.g. [Packix](https:/

@0penBrain
0penBrain / commitCount.sh
Last active March 8, 2024 23:54
The simplest way to get commit count of a GitHub repository through the API
curl -I -k "https://api.github.com/repos/:owner/:repo/commits?per_page=1" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p'
### And that's all !
# I saw many fighting with finding first commit SHA or similar fancy thing.
# Here we just rely on the GH API, asking commits at 1 per page and parsing the last page number in the header of the reply (whose body only holds the last commit !)
# So this is robust and bandwidth efficient. :)
# If one want the commit count of a specific SHA, just use :
curl -I -k "https://api.github.com/repos/:owner/:repo/commits?per_page=1&sha=:sha" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p'
@xtream1101
xtream1101 / Backup&RestoreRepo.md
Created June 29, 2019 12:38
Backup and restore a git repo using git bundle

Backup/archive a repo

  1. Clone the repo
git clone --mirror https://github.com/vuejs/vue
  1. cd into the cloned repo
  2. Create a bundle file in the parent directory
git bundle create ../vuejs_vue.bundle --all
@esamson
esamson / calibre-install-user.sh
Created November 10, 2018 10:45
Install Calibre on Linux without sudo
wget https://download.calibre-ebook.com/linux-installer.sh
sh linux-installer.sh install_dir=~/.local/opt isolated=True
#!/usr/bin/env python3
from __future__ import print_function
import frida
import sys
import json
import time
def on_message(message, payload):
if(message['type'] == 'send'):
// Discord all events!
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!)
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client
// Learn from this, do not just copy it mofo!
//
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584
// Last Updated -> Halloween 2022
/*
#!/jb/bin/bash
CYCRIPT_PORT=1337
function help {
echo "Syntax: $0 [-p PID | -P appname] [-l /path/to/yourdylib | -L feature]"
echo
echo For example:
echo " $0 -P Reddit.app -l /path/to/evil.dylib # Injects evil.dylib into the Reddit app"
echo " or"
@snorrelo
snorrelo / pushoverhttphandler.py
Created March 2, 2018 17:17
Logging handler for python for sending log messages via Pushover.
# Custom logging handler for python for sending log messages via Pushover.
# https://pushover.net/
#
# Extends HTTPHandler https://docs.python.org/3.6/library/logging.handlers.html#httphandler
import logging.handlers
class PushoverHTTPHandler(logging.handlers.HTTPHandler):
_APP_TOKEN = None