Skip to content

Instantly share code, notes, and snippets.

View matthacksteiner's full-sized avatar

Matthias Hacksteiner matthacksteiner

View GitHub Profile
@matthacksteiner
matthacksteiner / git-set-origin.md
Created November 2, 2021 12:48
git change origin

git remote set-url origin git@github.com:{USERNAME}/{PROJECTNAME}.git

@matthacksteiner
matthacksteiner / full-width.scss
Created June 1, 2021 10:06
Sass full-width mixin
.full-width {
width: 100vw;
position: relative;
left: 50%;
right: 50%;
margin-left: -50vw;
margin-right: -50vw;
}
//mixin to strech container over parent
@matthacksteiner
matthacksteiner / SoX trim 100
Created April 16, 2021 06:36
SoX trim all files by 100ms
for /R %f in ("*.wav") do ("C:\Program Files (x86)\sox-14-4-2\sox.exe" −−multi−threaded "%~f" "%~pf%~nf_converted.wav" trim 0.1)
@matthacksteiner
matthacksteiner / ffmpeg-trim-audio
Last active April 16, 2021 06:35
Trims 100ms of all audiofiles in subdiretories from the beginning
for /R %f in ("*.wav") do (ffmpeg.exe -i "%~f" -ss 0.1 -c copy "%~pf%~nf_converted.wav")
@matthacksteiner
matthacksteiner / ffmpeg convert recursively all wav to mp3
Last active April 15, 2021 14:03
Convert all wav files in a directory to a mp3
for /R %f in ("*.wav") do (ffmpeg.exe -i "%~f" -acodec mp3 "%~pf%~nf.mp3")
import Swiper from "swiper/bundle";
import "swiper/swiper-bundle.css";
window.addEventListener(
"load",
() => {
// swiper
var slider = document.querySelectorAll(".swiper-container");
for (let index = 0; index < slider.length; index++) {
slider[index].classList.add("swiper-container-" + index);
// remove meta box on custom template CUSTOM
add_action('init', 'remove_editor_CUSTOM');
function remove_editor_CUSTOM()
{
if (!is_admin()) {
return;
}
$current_post_id = filter_input(INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT);
$update_post_id = filter_input(INPUT_POST, 'post_ID', FILTER_SANITIZE_NUMBER_INT);
@matthacksteiner
matthacksteiner / gist:867ad7b9818774994157aab15f79ad22
Created September 7, 2020 08:03
Wordpress - disable Gutenberg, hide default meta boxes
*-----------------------------------------------------------------------------------*/
/* disable Gutenberg and clean up default meta boxes
/*-----------------------------------------------------------------------------------*/
add_filter('use_block_editor_for_post', '__return_false');
add_action('admin_menu', 'mypaletti_remove_meta_box');
function mypaletti_remove_meta_box()
{
@matthacksteiner
matthacksteiner / functions.php
Created September 7, 2020 08:02
Wordpress - display current used template page to super admin
function show_template() {
if( is_super_admin() ){
global $template;
print_r($template);
}
}
add_action('wp_footer', 'show_template');
@matthacksteiner
matthacksteiner / gitignore.txt
Last active May 13, 2020 09:51
Untrack files already added to git repository based on .gitignore
1. Commit all changes
2. git rm -r --cached .
3. git add .
4. git commit -m ".gitignore fix"