Skip to content

Instantly share code, notes, and snippets.

Paul Ryley pryley

Block or report user

Report or block pryley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MawKKe
MawKKe / split_ffmpeg.py
Last active Feb 2, 2020
Split audio file with ffmpeg based on chapter metadata
View split_ffmpeg.py
#!/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
drakakisgeo / gist:48dcab1539612c82449b9757940ac7ee
Last active Jan 16, 2019
Print Access Token from Laravel Passport
View gist:48dcab1539612c82449b9757940ac7ee
<?php
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
pryley / nativefier-dropbox-paper.md
Last active Apr 20, 2018
Nativefier customisations for Dropbox Paper
View nativefier-dropbox-paper.md

1. Create paper.css

body {
    -webkit-app-region: drag;
}
a,
button,
.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
levelsio / btc-eth-dca-buy.php
Last active Aug 6, 2019
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
View btc-eth-dca-buy.php
<?
//
// [ BUY BTC & ETH DAILY ON BITSTAMP ]
// by @levelsio
//
// 2017-08-23
//
// 1) buy $40/day BTC
// 2) buy $10/day ETH
//
@drakakisgeo
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 http://www.inmotionhosting.com/support/email/exim/find-spam-script-location-with-exim
@renatomefi
renatomefi / README.md
Last active Feb 8, 2017
Milhog start script for Ubuntu 14.04
View README.md

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: https://github.com/mailhog/MailHog/releases Save the binary at /opt/mailhog/mailhog Give it executable permission chmod +x /opt/mailhog/mailhog

Init script

Download the gist: https://gist.github.com/renatomefi/d133fea9cb5a7b00f91edb24b83d9a31#file-init-d-mailhog-sh Put it at /etc/init.d/mailhog

@cecilemuller
cecilemuller / letsencrypt_2019.md
Last active Feb 28, 2020
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)
View letsencrypt_2019.md

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 first.com and second.com.

Create folders for their files:

@so0k
so0k / gist:cdd24d0a4ad92014a1bc
Last active Jan 29, 2020 — forked from defunctzombie/gist:6518292
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:

Steps

setup the internal DNS zone file

  1. Login to digital ocean
  2. Click "DNS" on the right hand menu
@paulirish
paulirish / what-forces-layout.md
Last active Feb 27, 2020
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
You can’t perform that action at this time.