Skip to content

Instantly share code, notes, and snippets.

View gubi's full-sized avatar

Alessandro Gubitosi gubi

View GitHub Profile
@nwithan8
nwithan8 / README.md
Last active September 22, 2024 04:42
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 spotify_download.py [URL] to download all playlist items to the local directory.
@ManuelTS
ManuelTS / Convert2_432Hz.sh
Last active November 9, 2024 09:45
Batch convert all .mp3 files in the current directory to 432Hz with ffmpeg
#!/bin/bash
# Batch convert all .mp3 files in the current directory to 432Hz with ffmpeg
# Options
suffix="false" # Append the -432Hz suffix or not
oldIFS=$IFS
IFS=$'\n'
set -f # Deal with blanks and special characters in file names of the file command and in for loop
@heywens
heywens / apache-cors-dev-mode.md
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>
	ServerAdmin [email protected]
	DocumentRoot "/Users/wens/dev/laravel/public"
	ServerName dummy-host.example.com
@rudrathegreat
rudrathegreat / Loading.py
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
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
ywwwtseng / host-react-app-on-apache-server.md
Last active October 28, 2024 19:15
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
crittermike / wget.sh
Last active October 30, 2024 20:38
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 yoursite.com --no-parent yoursite.com
# 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
gubi / README.md
Last active February 9, 2017 00:32
Basic API routing with klein. For HTTP Status Codes see https://github.com/gubi/HTTP-Error-Codes

Basic API routing

PHP klein config for a basic API routing

@devcfgc
devcfgc / fix_network_manager_ubuntu.txt
Last active March 24, 2020 01:34
fix network-manager ubuntu resolv.conf
http://askubuntu.com/questions/627899/nameserver-127-0-1-1-in-resolv-conf-wont-go-away
NetworkManager is the program which (via the resolvconf utility) inserts address 127.0.1.1 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 127.0.1.1.
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
[main]
plugins=ifupdown,keyfile,ofono
@daveyjones
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 (http://wp-cli.org/)
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) {