Skip to content

Instantly share code, notes, and snippets.

@vesper8
vesper8 / default.nginx.conf
Created October 7, 2018 09:10 — forked from jjhiew/default.nginx.conf
Nginx configuration to setup SSL Termination and Reverse Proxy for Sendgrid Link Tracking
# Should go into `/etc/nginx/sites-available` as file named `default`
# Redirect HTTP to HTTPS
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443;
@vesper8
vesper8 / default.conf
Created July 6, 2018 03:17
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
# Create the project directory
# This will hold both the Bedrock and Trellis installs
mkdir $1
cd $1 && git init && cd ..
# Install Roots Bedrock
echo -e "\033[33;36m Installing Bedrock via Composer into $1/site ...";
composer create-project roots/bedrock $1/site
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@vesper8
vesper8 / History|-1033d7fb|entries.json
Last active May 21, 2022 18:22
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Volumes/Memories/Photos/2012/PictureBright/DEV/_NS/2020/omega-api.nomadsoulmates.com/tests/Feature/Money/AppleAppStoreTest.php","entries":[{"id":"EDPV.php","source":"searchReplace.source","timestamp":1653050528409}]}
@vesper8
vesper8 / haversine.php
Created February 18, 2018 11:07 — forked from fhferreira/haversine.php
Haversine Method for model Laravel.
<?php
/*
* find the n closest locations
* @param Model $query eloquent model
* @param float $lat latitude of the point of interest
* @param float $lng longitude of the point of interest
* @param float $max_distance distance in miles or km
* @param string $units miles or kilometers
* @param Array $fiels to return
* @return array

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@vesper8
vesper8 / Contract Killer 3.md
Created December 27, 2017 21:25 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@vesper8
vesper8 / packed-pixels-switchresx.md
Created December 21, 2017 21:07 — forked from sfcgeorge/packed-pixels-switchresx.md
Packed Pixels HiDPI Retina using SwitchResX

On OS X the Packed Pixels display won't automatically show up as "Retina" or "HiDPI" resolution, instead the OS will use the full resolution of the display making everything tiny. This can be changed using the 3rd party app (non-free) SwitchResX.

First, download SwitchResX.

You can play with the resolutions for the Packed Pixels which is probably listed as Color LCD (2). However not all of the HiDPI resolutions work due to an OS X bug. If you are happy with any of the ones that do work then stop here, else continue.

If you're on El Capitan or later you need to disable System Integrity Protection (temporarily) to add a custom resolution for Packed Pixels. Follow the instructions from SwitchResX creator.

Now add a Custom Resolution that is "scaled". It must be 2 pixels bigger or smaller than the native resolution in one direction (this is the OS X quirk). I found bigger makes it slightly blurry so go w

@vesper8
vesper8 / fix-homebrew-npm.md
Created December 6, 2017 04:13 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.