Skip to content

Instantly share code, notes, and snippets.

View xeruf's full-sized avatar
🚵‍♂️
Exploring

Janek xeruf

🚵‍♂️
Exploring
View GitHub Profile
@adierebel
adierebel / build.gradle.kts
Last active March 9, 2024 05:25
Proguard + Shadow JAR for non Android Project (Java 11 Swing)
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import proguard.gradle.ProGuardTask
plugins {
id("application")
id("org.jetbrains.kotlin.jvm") version "1.6.0"
id("com.github.johnrengelman.shadow") version "7.1.0"
}
@greg-randall
greg-randall / index.php
Last active December 1, 2022 15:42 — forked from vsoch/index.php
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, and $feedDesc. Then navigate to the folder on the web to see the xml feed.
<?php
header("Content-type: text/xml");
$feed_name = "My Audio Feed";
$feed_description = "Feed for the my audio files in some server folder";
$base_url = strtok('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '?'); //gets the current page's url. strips off the url's parameters
$allowed_extensions = array('mp4','mp3');
?>
<?php echo '<?xml version="1.0"?>'; //we have to use php to output the "<?" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
@Jekis
Jekis / toggle_swap.sh
Last active August 17, 2024 01:06
Empty swap. Clear swap. Move swap to RAM. Ubuntu.
#!/bin/bash
function echo_mem_stat () {
mem_total="$(free | grep 'Mem:' | awk '{print $2}')"
free_mem="$(free | grep 'Mem:' | awk '{print $7}')"
mem_percentage=$(($free_mem * 100 / $mem_total))
swap_total="$(free | grep 'Swap:' | awk '{print $2}')"
used_swap="$(free | grep 'Swap:' | awk '{print $3}')"
swap_percentage=$(($used_swap * 100 / $swap_total))
@krishpop
krishpop / export-toby.js
Last active March 21, 2024 22:12
Export Toby
// code courtesy of Toby team
chrome.storage.local.get("state", o => (
((f, t) => {
let e = document.createElement("a");
e.setAttribute("href", `data:text/plain;charset=utf-8,${encodeURIComponent(t)}`);
e.setAttribute("download", f);
e.click();
})(`TobyBackup${Date.now()}.json`, o.state)
));
@yukimochi
yukimochi / Caddyfile.caddy1
Last active June 30, 2024 03:03
For Mastodon Caddy Setting file. (Based on official Nginx configuration example) [Last Update: Mar 07, 2021]
https://yourdomain.example.com/ {
log / /var/log/caddy/mastodon.log "{combined}" {
rotate_age 90
}
root /home/mastodon/live/public
gzip
header / {
Strict-Transport-Security "max-age=31536000"
}
@Francesco149
Francesco149 / osu_on_linux_overhaul.md
Last active July 29, 2024 03:55
Ultimate guide to low-latency osu on linux
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active September 19, 2024 19:00
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@vsoch
vsoch / index.php
Last active June 2, 2024 14:28
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, $feedDesc, $feedURL, and $feedBaseURL. Then navigate to the folder on the web to see the xml feed. Done!
<?php
header('Content-type: text/xml');
/*
Runs from a directory containing files to provide an
RSS 2.0 feed that contains the list and modification times for all the
files.
*/
$feedName = "My Audio Feed";
$feedDesc = "Feed for the my audio files in some server folder";