Skip to content

Instantly share code, notes, and snippets.

reinink / query.sql
Last active Jan 22, 2022
Text search across multiple tables using MySQL
View query.sql
left join
companies on = users.company_id
where ( like 'TERM%' or
first_name like 'TERM%' or
MawKKe /
Last active Aug 7, 2021
MOVED TO: | Split audio file with ffmpeg based on chapter metadata
#!/usr/bin/env python3
import sys
import os
import re
import subprocess as sub
import argparse
import tempfile
import json
from concurrent.futures import ThreadPoolExecutor, as_completed
drakakisgeo / gist:48dcab1539612c82449b9757940ac7ee
Last active Nov 22, 2021
Print Access Token from Laravel Passport
View gist:48dcab1539612c82449b9757940ac7ee
namespace App\Traits;
use App\User;
use DateTime;
use GuzzleHttp\Psr7\Response;
use Illuminate\Events\Dispatcher;
use Laravel\Passport\Bridge\AccessToken;
use Laravel\Passport\Bridge\AccessTokenRepository;
pryley /
Last active Apr 20, 2018
Nativefier customisations for Dropbox Paper

1. Create paper.css

body {
    -webkit-app-region: drag;
.ace-editor {
    -webkit-app-region: no-drag;
View tailwind-rgba.js
// Add this to your 'plugins' array in your tailwind config file.
// This creates classes suffixed with an opacity level for each bg colour
// For example, .bg-red would have .bg-red-10 through .bg-red-100 for 0.10% opacity background and 100% opacity respectively.
({addUtilities, config}) => {
let colors = config('colors', []);
const newColors = {};
let hexToRgb = (hex) => {
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? {
r: parseInt(result[1], 16),
levelsio / btc-eth-dca-buy.php
Last active Sep 2, 2021
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
View btc-eth-dca-buy.php
// by @levelsio
// 2017-08-23
// 1) buy $40/day BTC
// 2) buy $10/day ETH
drakakisgeo / Check Spam source
Created Dec 2, 2016
Check Spam sourcein a shared server
View Check Spam source
grep cwd /var/log/exim_mainlog | grep -v /var/spool | awk -F"cwd=" '{print $2}' | awk '{print $1}' | sort | uniq -c | sort -n
More info at
renatomefi /
Last active Dec 13, 2021
Milhog start script for Ubuntu 14.04

This is a simple way to install mailhog, might not be the best solution for everyone, you can look for repositories, still have to register the binary in the PATH, among other things, this is a manual simple install.

Binary download

Download mailhog from the releases page on github: Save the binary at /opt/mailhog/mailhog Give it executable permission chmod +x /opt/mailhog/mailhog

Init script

Download the gist: Put it at /etc/init.d/mailhog

cecilemuller /
Last active Jan 22, 2022
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)

Virtual hosts

Let's say you want to host domains and

Create folders for their files:

so0k / gist:cdd24d0a4ad92014a1bc
Last active Jul 20, 2021
droplet discovery over digitalocean private networks
View gist:cdd24d0a4ad92014a1bc

Digital Ocean recently released private networking support in their NYC2 Data center.

They also published a blog post on how to setup a new droplet with private networking. But one thing the post doesn't do is tell you how to scale your private network for many boxes. One approach is obviously to edit /etc/hosts (but this gets annoying when you add a new box). A better way is to create an internal DNS zone (via the digital ocean web interface) and have your droplets use it:


setup the internal DNS zone file

  1. Login to digital ocean
  2. Click "DNS" on the right hand menu