Skip to content

Instantly share code, notes, and snippets.

@pryley
pryley / letsencrypt_2018.md
Created May 2, 2019 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)
View letsencrypt_2018.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:

@pryley
pryley / nativefier-scrumpy.md
Last active Apr 26, 2018
Nativefier customisations for Scrumpy
View nativefier-scrumpy.md

1. Create scrumpy.css

body {
    -webkit-app-region: drag;
}
a,
button,
.grid__item {
    -webkit-app-region: no-drag;
}
@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;
}
@pryley
pryley / btc-eth-dca-buy.php
Created Oct 13, 2017 — forked from levelsio/btc-eth-dca-buy.php
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
//
@pryley
pryley / functions.php
Last active Mar 30, 2017
[Site Reviews snippet] Custom text strings
View functions.php
<?php
// Translate text strings
// http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
add_filter( 'gettext', function( $translated_text, $text, $domain ) {
    return ( $domain == 'site-reviews' && $translated_text == 'Submit your review' )
        ? __( 'Make it so!', 'site-reviews-custom' )
        : $translated_text;
}, 20, 3 );
@pryley
pryley / functions.php
Created Mar 23, 2017
[Site Reviews snippet] Remove the dash in front of the review author name.
View functions.php
<?php
// Add this snippet to your active theme's functions.php file
add_filter( 'site-reviews/rendered/partial', function( $rendered, $partial ) {
if( $partial == 'reviews' ) {
$rendered = str_replace( '<p class="glsr-review-author">&mdash;', '<p class="glsr-review-author">', $rendered );
}
return $rendered;
}, 10, 2 );
@pryley
pryley / DioscuriValetDriver.php
Last active Feb 19, 2017
Laravel Valet driver for Dioscuri
View DioscuriValetDriver.php
<?php
class DioscuriValetDriver extends BasicValetDriver
{
/**
* Mutate the incoming URI.
*
* @param string $uri
* @return string
*/
@pryley
pryley / mailhog.dev
Created Feb 8, 2017
Run Mailhog on Laravel Valet (~/.valet/Nginx/mailhog.dev)
View mailhog.dev
server {
listen 80;
server_name mailhog.dev;
location / {
proxy_pass http://127.0.0.1:8025/;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
@pryley
pryley / phpv
Created Feb 8, 2017
Switch PHP versions for Laravel Valet
View phpv
#!/bin/bash
# Check that homebrew is installed
if [[ "" == "$(command -v brew)" ]]; then
echo "switch-php requires homebrew to manage installed versions of PHP."
exit 1
fi
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
View keybase.md

Keybase proof

I hereby claim:

  • I am pryley on github.
  • I am pryley (https://keybase.io/pryley) on keybase.
  • I have a public key ASCIgelMI6dpyCg15fHavShFYmjSZ3ERl3GebPxokuGHOwo

To claim this, I am signing this object: