Skip to content

Instantly share code, notes, and snippets.

@Nilpo
Nilpo / MaidenHeadLocater.php
Last active April 6, 2023 09:44
Calculate Maidenhead Grid Square Locator from Latitude/Longitude coordinate pairs.
<?php
/**
* Calculates a Maidenhead Grid Square Locator containing
* the given latitude/longitude (WGS84) coordinate pair.
*
* @param string|float $input_lat
* @param string|float $input_lng
* @return string
*/
@Nilpo
Nilpo / Installing The Sword Project.md
Last active March 5, 2023 01:06
Instruction for installing The Sword Project on Mac and Linux. This is intended for module developers.

Installing The Sword Project

I found installing Sword from source to be problematic on both Mac and Linux. Thankfully, I found hidden in some documentation that it is available through common repositories. Unfortunately, the documentation was not thorough. Here's what worked for me on Mac OSX 10.9.5 and Linux Mint 17.3 "Rosa". These instructions should work on any recent version of Mac and any flavor of Ubuntu.

Installing Sword Package

The process for installing Sword differs a bit between Mac and Linux. I used Homebrew on Mac, but MacPorts should work just fine. Linux was a little less friendly, but I did get it working.

Instructions for Mac Users

@Nilpo
Nilpo / post-WSL.md
Created April 1, 2019 06:16 — forked from rkristelijn/post-WSL.md
Installing node via windows subsystem for linux

Overview

Below is a comparison from one of the resources I used. I don't think the comparison is done using the same hardware, but the big take away is that Windows without WSL is a no-go, and Windows WSL underperforms for Linux on bare metal and even Virtual Linux on a Windows Guest. I still have to do this comparison myself using my Udoo with dualboot.

System Performance
Mac Mini 2012 Core i5 10GB RAM 217.6 sec
Windows WSL 335 sec
Linux Mint Bare Metal 182.4 sec
VirtualBox 124 sec
@Nilpo
Nilpo / Ketarin_ParseVersionFromUrl.md
Created February 28, 2023 11:20 — forked from sheldonhull/Ketarin_ParseVersionFromUrl.md
Using Regex in Ketarin to parse textual content from url
@Nilpo
Nilpo / wpbackup.sh
Created December 8, 2015 23:27
A Wordpress Backup Shell Script
#!/bin/bash
# usage: ./wpbackup.sh domain.com
DOMAIN="$1"; # domain name to backup
BACKUP="$HOME/backups"; # store backups here
HOSTPATH="$HOME"; # path where hosted domains are
backmeup () {
local _N _U _P _H FS FT TD WP;
@Nilpo
Nilpo / Boot RetroPie from USB.md
Last active December 26, 2022 04:32
How to boot RetroPie (or Raspbian) from a USB drive on the Raspberry Pi 3 B(+)

Boot RetroPie from USB on the Raspberry Pi 3 B(+)

You will need a Raspberry Pi 3 B(+) with a microSD card running RetroPie (or Raspbian).

  1. Update Raspbian.

    $ sudo apt-get update && sudo apt-get upgrade -y
@Nilpo
Nilpo / .env
Last active December 7, 2022 18:27 — forked from gilbitron/CaddyController.php
Enabling HTTPS (SSL) for Laravel Sail using Caddy
APP_URL=https://laravel.test
APP_SERVICE=laravel.test
[...]
@Nilpo
Nilpo / GitHub-Forking.md
Created April 24, 2019 06:41 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@Nilpo
Nilpo / INSTALL.md
Last active October 24, 2022 14:02
Instal Plex on Asus Tinker Board
  1. In terminal, upgrade TinkerOS.

    sudo apt update && apt upgrade -y
    sudo apt dist-upgrade
  2. Install avahi-daemon