Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pryley
pryley / phpv
Created February 8, 2017 03:27
Switch PHP versions for Laravel Valet
#!/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
@pryley
pryley / mailhog.dev
Created February 8, 2017 04:25
Run Mailhog on Laravel Valet (~/.valet/Nginx/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 / DioscuriValetDriver.php
Last active February 19, 2017 02:52
Laravel Valet driver for Dioscuri
<?php
class DioscuriValetDriver extends BasicValetDriver
{
/**
* Mutate the incoming URI.
*
* @param string $uri
* @return string
*/
@pryley
pryley / functions.php
Created March 23, 2017 22:34
[Site Reviews snippet] Remove the dash in front of the review author name.
<?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 / functions.php
Last active March 30, 2017 14:11
[Site Reviews snippet] Custom text strings
<?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 / btc-eth-dca-buy.php
Created October 13, 2017 21:44 — forked from levelsio/btc-eth-dca-buy.php
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
<?
//
// [ BUY BTC & ETH DAILY ON BITSTAMP ]
// by @levelsio
//
// 2017-08-23
//
// 1) buy $40/day BTC
// 2) buy $10/day ETH
//
@pryley
pryley / nativefier-dropbox-paper.md
Last active April 20, 2018 09:12
Nativefier customisations for Dropbox Paper

1. Create paper.css

body {
    -webkit-app-region: drag;
}
a,
button,
.ace-editor {
    -webkit-app-region: no-drag;
}
@pryley
pryley / nativefier-scrumpy.md
Last active April 26, 2018 11:27
Nativefier customisations for Scrumpy

1. Create scrumpy.css

body {
    -webkit-app-region: drag;
}
a,
button,
.grid__item {
    -webkit-app-region: no-drag;
}
@pryley
pryley / letsencrypt_2018.md
Created May 2, 2019 11:56 — 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)

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 / index.html
Last active May 15, 2020 04:15
Tailwindcss debug grid #tailwindcss
<!DOCTYPE html>
<html class="debug">
<head>
<title></title>
</head>
<body>
<section>
<div class="container">
<div class="bg-red-100 row">
<div class="bg-blue-100 col p-8 | sm:w-1/2"></div>