Skip to content

Instantly share code, notes, and snippets.

View gubi's full-sized avatar

Alessandro Gubitosi gubi

View GitHub Profile
nwithan8 /
Last active February 15, 2024 17:08
Script to download songs from a Spotify playlist

This does NOT require Spotify Premium or logging into your Spotify account.

  1. Install dependencies with pip3 install -r requirements.txt
  2. Get Spotify playlist share URL by clicking the three dots next to a playlist -> Share -> Copy Link
  3. Run python3 [URL] to download all playlist items to the local directory.
ManuelTS /
Last active May 17, 2024 04:20
Batch convert all .mp3 files in the current directory to 432Hz with ffmpeg
# Batch convert all .mp3 files in the current directory to 432Hz with ffmpeg
# Options
suffix="false" # Append the -432Hz suffix or not
set -f # Deal with blanks and special characters in file names of the file command and in for loop
heywens /
Last active April 19, 2023 14:07
Apache CORS (For Development Mode Only)

Here's a sample VirtualHost configuration to enable CORS (Cross-Origin Resource Sharing) on Apache, allowing my React app to connect to server (Laravel) during development.

Listen 8080
NameVirtualHost *:8080

<VirtualHost *:8080>
	DocumentRoot "/Users/wens/dev/laravel/public"
rudrathegreat /
Last active May 12, 2024 20:33
A Simple Loading Animation For the Command Line Using Python 3
This program is designed to create
and animate a simple loading animation.
from sys import stdout as terminal
from time import sleep
from itertools import cycle
from threading import Thread
codeithuman / index.js
Created October 11, 2018 15:46
Example index.js for a new React Native Project
import { AppRegistry } from 'react-native';
import App from './App';
AppRegistry.registerComponent('HelloWorld', () => App);
ywwwtseng /
Last active May 3, 2024 15:52
Host react application on Apache server

Host react application on Apache server

Step 1 : Create your app

$ npm install -g create-react-app 
$ create-react-app my-app

Step 2 : Build it for production

crittermike /
Last active March 26, 2024 22:49
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains --no-parent
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
gubi /
Last active February 9, 2017 00:32
Basic API routing with klein. For HTTP Status Codes see

Basic API routing

PHP klein config for a basic API routing

devcfgc / fix_network_manager_ubuntu.txt
Last active March 24, 2020 01:34
fix network-manager ubuntu resolv.conf
NetworkManager is the program which (via the resolvconf utility) inserts address into resolv.conf. NM inserts that address if an only if it is configured to start an instance of the dnsmasq program to serve as a local forwarding nameserver. That dnsmasq instance listens for queries at address
If you do not want to use a local forwarding nameserver then configure NetworkManager not to start a dnsmasq instance and not to insert that address. In /etc/NetworkManager/NetworkManager.conf comment out the line dns=dnsmasq
sudo nano /etc/NetworkManager/NetworkManager.conf
daveyjones / regenerate-thumbnails.js
Last active June 20, 2023 16:03
Insanely fast multi-core Node.js script for generating (or regenerating) custom WordPress image sizes (e.g. thumbnails) for very large media libraries
// Your server must have wp-cli installed (
var async = require("async");
var exec = require("child_process").exec;
var cores = 32; // Adjust the number of cores to match your environment
var total = 0;
var finished = 0;
var q = async.queue(function(task, callback) {