Skip to content

Instantly share code, notes, and snippets.

View mludi's full-sized avatar

Matthias Ludwig mludi

View GitHub Profile
@mludi
mludi / main.py
Created August 14, 2020 10:03
Convert a3 pdf to a4
import os
import re
files = os.listdir(os.getcwd())
for file in os.listdir(os.getcwd()):
if file.endswith(".pdf"):
escaped = re.escape(file)
print(escaped)
os.system(f"pdfposter {escaped} splitted-{escaped} -m a4 -p 2x1a4")
<?php
// @formatter:off
/**
* A helper file for Laravel, to provide autocomplete information to your IDE
* Generated for Laravel 7.14.1 on 2020-06-08 06:21:19.
*
* This file should not be included in your code, only analyzed by your IDE!
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
### Keybase proof
I hereby claim:
* I am mludi on github.
* I am matzl (https://keybase.io/matzl) on keybase.
* I have a public key ASCmUs4byWz6bnn1lF4WLjPfLmGobIMgSPq6dUB9XWcT1go
To claim this, I am signing this object:
<?php
public function sendMessage($data, $token, $notificationType)
{
$url = 'https://fcm.googleapis.com/fcm/send';
/**
* * If you'd like to send to mulitple devices 'registration_ids' => [$tokens],
*/
$postFields = json_encode([
'to' => $token,
@mludi
mludi / gist:d0e37254d297ca5821f1a43d2c7d6cd2
Created October 17, 2018 09:54
Wordpress Image Gallery Limit
[gallery type='flickr' photoset_id='72157631510267516' layout='mosaic' count='30' more='Mehr anzeigen']
@mludi
mludi / script.sql
Created October 17, 2018 07:39
Drop all MySQL Database tables
mysqldump --no-data --add-drop-table DB_NAME | grep ^DROP | mysql -v DB_NAME
@mludi
mludi / script.sh
Created October 16, 2018 12:29
Remove all files in a folder, but exclude given
#!/bin/bash
ls | grep -v -E '(1|2)' | xargs rm -rf
@mludi
mludi / ViewController.swift
Created October 4, 2017 10:42
Show usage of Swift enum
import UIKit
enum Style: String {
case light, dark
}
class ViewController: UIViewController {
let style: Style
#! /bin/bash
cd ~
sudo apt-get update -y
sudo apt-get install clang libicu-dev binutils git -y
sudo apt-get install libcurl4-openssl-dev -y
sudo apt-get install libpython2.7 libpython2.7-dev -y
sudo apt-get install libmysqlclient-dev -y
wget https://swift.org/builds/swift-3.0-release/ubuntu1510/swift-3.0-RELEASE/swift-3.0-RELEASE-ubuntu15.10.tar.gz
tar zxf swift-3.0-RELEASE-ubuntu15.10.tar.gz
sudo mv swift-3.0-RELEASE-ubuntu15.10 /swift-3.0