Skip to content

Instantly share code, notes, and snippets.

View Gummibeer's full-sized avatar
🐼
beary busy

Tom Herrmann Gummibeer

🐼
beary busy
View GitHub Profile
@Gummibeer
Gummibeer / steam.sh
Created August 16, 2017 11:00
steam.sh
LD_PRELOAD='/usr/$LIB/libstdc++.so.6' steam
@Gummibeer
Gummibeer / setup.sh
Created September 7, 2017 10:25
install new ubuntu
sudo add-apt-repository ppa:numix/ppa
sudo add-apt-repository ppa:papirus/papirus
sudo apt update && sudo apt install papirus-icon-theme numix-gtk-theme numix-icon-theme-circle unity-tweak-tool
sudo mkdir /etc/lightdm/lightdm.conf.d
sudo sh -c 'printf "[SeatDefaults]\nallow-guest=false\n" > /etc/lightdm/lightdm.conf.d/50-no-guest.conf'
sudo apt-get install git php7.0-cgi php7.0-cli php7.0-mcrypt php7.0-mbstring php7.0-xml php7.0-zip php7.0-json
@Gummibeer
Gummibeer / ecosia_bot.js
Last active December 4, 2017 13:11
This script plants trees by botting Ecosia search
Array.prototype.random = function() {
return this[Math.floor(Math.random() * this.length)];
};
var properties = [
'car',
'house',
'phone',
'money'
];
@Gummibeer
Gummibeer / gif2mp4.sh
Last active May 10, 2019 11:55
ffmpeg snippets
#!/bin/bash
function error_exit {
echo "$1" >&2 ## Send message to stderr. Exclude >&2 if you don't want it that way.
exit "${2:-1}" ## Return a code specified by $2 or 1 by default.
}
if [ $# -eq 0 ]; then
error_exit "No input filepath given"
fi
@Gummibeer
Gummibeer / app-Libs-Formatter.php
Created August 10, 2019 21:40
float & date formatting of model attributes (- are folder separators)
<?php
namespace App\Libs;
use DateTime;
class Formatter
{
public static function float(float $float, int $decimals = 2): string
{
@Gummibeer
Gummibeer / encoding-video.md
Created September 5, 2019 09:54 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@Gummibeer
Gummibeer / index.html
Last active September 10, 2019 20:07
Tailwind Admin Dashboard Template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Tailwind Admin Dashboard</title>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
</head>
@Gummibeer
Gummibeer / app__Http__Middleware__Localized.php
Created October 8, 2019 15:16
set all locales if app locale changes
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
class Localized
{
@Gummibeer
Gummibeer / Car.php
Last active January 8, 2020 11:07
Car-User-Role permission scratch
<?php
class Car extends Model
{
public function users()
{
return $this->belongsToMany(User::class, 'car_user_role')
->using(CarUserRole::class)
->withPivot('role_id', 'user_id', 'car_id');
}
function waitForElement(selector) {
return new Promise(function(resolve, reject) {
var runs = 1;
var interval = setInterval(function() {
if (runs >= 30) {
clearInterval(interval);
reject(new Error('max runs exceeded'));
}
var el = document.querySelector(selector);