Skip to content

Instantly share code, notes, and snippets.

View ManuelTS's full-sized avatar
Time is the most valuable what each one of us has.

Manuel T. Schrempf ManuelTS

Time is the most valuable what each one of us has.
View GitHub Profile
@ManuelTS
ManuelTS / install_phantomJs.sh
Last active May 5, 2023 12:55
This script installs PhantomJS on your Debian/Ubuntu System
#!/usr/bin/env bash
# This script installs PhantomJS on your Debian/Ubuntu System
#
# Taken from https://gist.github.com/julionc/7476620#gistcomment-2030572 and changed the download directory
#
# This script must be run as root:
# sudo sh install_phantomjs.sh
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
@ManuelTS
ManuelTS / install_casperJs.sh
Created September 28, 2017 08:38
Installs CasperJS in your Debian/Ubuntu System.
#!/usr/bin/env bash
# Installs CasperJS in your Debian/Ubuntu System. Idea taken from http://docs.casperjs.org/en/latest/installation.html
#
# After you installed PhantomJS with https://gist.github.com/ManuelTS/935155f423374e950566d05d1448038d
# run this script as root with:
# sudo sh install_casperJs.sh
CASPER_JS="casperjs"
cd /usr/local/share/
@ManuelTS
ManuelTS / UninstallUnity.sh
Last active January 16, 2018 05:01
Uninstalls the Unity Editor on Ubuntu
#!/usr/bin/env bash
# Uninstalls the Unity Editor on Ubuntu.
#
# Tested for Unity 2017.30f1 downloaded from https://beta.unity3d.com/download/3c89f8d277f5/public_download.html
# and Ubuntu 17.10, but it should work with other version too.
#
# Unity is expected to be installed in your home folder, otherwise
# change the first remove command to your installation path.
#
# Execute this program as root, e.g. "sudo sh UninstallUnity.sh"
@ManuelTS
ManuelTS / SaveLoadWav.cs
Created February 5, 2018 11:11
Saves and loads in Unity .wav files in the Application.persistentDataPath
/* Copyright (c) 2018 Manuel T. Schrempf
This software is provided 'as-is', without any express or implied warranty. In
no event will the authors be held liable for any damages arising from the use
of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
@ManuelTS
ManuelTS / FixPNGAndroidIssue.txt
Created June 30, 2018 09:49
The Android emulator can show this error "iCCP: Not recognizing known sRGB profile" multiple times. This command is a fix for all PNG files in your project structure. Inspired from https://gist.github.com/rupakraj/5e7e58a666282ca9c2f7
To resolve the errors for all PNG files from your project navigate in your top project folder and execute:
find . -name "*.png" -exec pngcrush -ow -rem allb -reduce {} +
If you want to know what all commands with their arguments do use the corresponding man pages.
@ManuelTS
ManuelTS / bibtexOriginalBSTfileChange.md
Last active February 29, 2020 09:52
It was hard to find a simple and short description to change the default BibTeX citation fields. So, here an example of a change from \bibliographystyle{unsrt} @Article one.

Change BibTeX Original BST Files

It was hard to find a simple and short description to change the used citation fields of the standard BibTeX .bst files, which are used by the command \bibliographystyle{}.

All found resources with online search engines were an overhead. Hence:

  1. Locate your .bst files on your system
sudo find $directory -type f -name "*.bst"
@ManuelTS
ManuelTS / form.html
Last active April 30, 2020 06:19
Angular Forms: A ControlValueAccessor for a FormArray with a Validator to give you the full control of single array element access and validation. For an explanation of the single files please read: https://www.redlink.at/en/controlvalueaccessor-for-an-array-plus-validator/
<!-- In your main form, include the generated app-your-array component simply as -->
<form>
<!-- ... -->
<app-your-array [(ngModel)]="yourFormObject.yourArrayProperty" name="yourArray">
</app-your-array>
<!-- ... -->
</form>
@ManuelTS
ManuelTS / InstallApache2MySQLWordpressUbuntu20.04.md
Last active October 16, 2020 13:19
Install Apache2, MySQL, and Wordpress on Ubuntu 20.04

Install Apache2, MySQL, and Wordpress on Ubuntu 20.04

Install Apache2 and MySQL

sudo apt update -y && \ # Update dependencies
sudo apt upgrade -y && \
sudo apt install -y php7.4 php7.4-curl php7.4-gd php7.4-json php7.4-mbstring php7.4-xml libapache2-mod-php7.4 php7.4-mysql apache2 apache2-bin apache2-data apache2-utils mysql-server phpmyadmin && \ # Install dependencies
sudo mysql_secure_installation
@ManuelTS
ManuelTS / PHP_Readable_Debug_Print.php
Created September 14, 2020 13:50
Prints a PHP object or array in a human readable matter within the browser.
echo '<pre>'.print_r($object_2_print, true).'</pre>';
die;
@ManuelTS
ManuelTS / Convert2_432Hz.sh
Last active October 23, 2023 16:24
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