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 / 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
@thomasjsn
thomasjsn / ElasticRecreateIndex.php
Created February 13, 2017 09:26
Laravel console command for reindexing Elasticsearch.
<?php
namespace App\Console\Commands;
use Elasticsearch\ClientBuilder;
use Illuminate\Console\Command;
class ElasticRecreateIndex extends Command
{
/**
@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>
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);
@jarektkaczyk
jarektkaczyk / Laravel5.1-sort-collection-by-multiple-integer-fields.php
Created August 18, 2015 12:36
Laravel 5 - how to sort collection by multiple integer fields
<?php
>>> $col = collect(json_decode(json_encode([['id' => 1,'bool' => 0, 'count' => 15], ['id' => 2, 'bool' => 1, 'count' => 20], ['id' => 3, 'bool' => 0, 'count' => 10], ['id' => 4, 'bool' => 1, 'count' => 16]])))
=> Illuminate\Support\Collection {#935
all: [
{#936
+"id": 1
+"bool": 0
+"count": 15
}
@Gummibeer
Gummibeer / git_delete_untracked_branches.sh
Last active June 19, 2020 15:05
git_delete_untracked_branches.sh
# EN
git checkout master && git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D
# DE
git checkout master && git fetch -p && git branch -vv | awk '/: entfernt]/{print $1}' | xargs git branch -D
@bertbalcaen
bertbalcaen / Extract all frames from a 24 fps movie using ffmpeg
Last active April 6, 2021 09:02
Extract all frames from a 24 fps movie using ffmpeg
ffmpeg -i shame-run.mov -r 24/1 test/output%03d.jpg
@imfing
imfing / dynamic_svg.md
Last active April 22, 2021 06:44
Using inline SVGs in Vue components

An alternative way to implement "dynamic" svg is using html-loader.

First, create a component for svg, SvgIcon.vue:

<template>
  <div v-html="require(`../../assets/icon-${icon}.svg`)"></div>
</template>

<script>
export default {
@rtconner
rtconner / SftpServiceProvider.php
Last active May 28, 2021 12:36
Provider so you can add a 'sftp' connection in Laravel 5 filesystems.php - "Call to undefined method League\Flysystem\Filesystem::createSftpDriver"
<?php
namespace App\Providers;
use League\Flysystem\Sftp\SftpAdapter;
use Storage;
use League\Flysystem\Filesystem;
use Illuminate\Support\ServiceProvider;
/**