Skip to content

Instantly share code, notes, and snippets.

@Nilpo
Nilpo / Session.php
Last active Feb 9, 2021
A simple session wrapper class to provide static OOP access to PHP sessions.
View Session.php
<?php
/**
* Session Helper Class
*
* A simple session wrapper class.
*
* Recommended for use with PHP 5.4.0 or higher. (Not required.)
*
* Usage Example:
@Nilpo
Nilpo / flat-ui-color-palette.scss
Created Jan 29, 2016
SCSS Flat UI Color Palette from flatuicolors.com
View flat-ui-color-palette.scss
// Flat UI Color Palette
// by Rob Dunham http://robdunham.info/
// colors taken from flatuicolors.com
// https://gist.github.com/Nilpo/344bcfb500907661ea9b
// flatuicolors.com
$fui-turquoise: #1abc9c;
$fui-green-sea: #16a085;
$fui-sun-flower: #f1c40f;
$fui-orange: #f39c12;
@Nilpo
Nilpo / INSTALL.md
Last active Aug 30, 2020
Instal Plex on Asus Tinker Board
View INSTALL.md
  1. In terminal, upgrade TinkerOS.

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

@Nilpo
Nilpo / How to passthrough SATA drives directly on VMWare ESXi 6.5 as RDMs.md
Last active Jul 13, 2020 — forked from Hengjie/tutorial.md
How to passthrough SATA drives directly on VMWare ESXi 6.5 as RDMs
View How to passthrough SATA drives directly on VMWare ESXi 6.5 as RDMs.md

How to passthrough SATA drives directly on VMWare ESXi 6.5 as RDMs

There aren't many tutorials about this, the only tutorials I've found were about passing through entire PCIe cards to VMs, or refered to old ESXi versions (below 6.5) that used a more comprehensive desktop client instead of the web app. In v6.5, the web app was introduced and the desktop client was deprecated. You used to be able to setup RDMs in the desktop client, but with the introduction of the web console, this is no longer the case. This tutorial shows you how to pass SATA HDDs to the virtual machine on VMWare ESXi 6.5. This tutorial is partially based on VMWare's own KB and the now deprecated Forza IT blog post.

A word about VMWare ESXi 6.7

There is now an option while editing your VM's settings to add a New raw disk when you click `Add ha

@Nilpo
Nilpo / CustomException.php
Last active May 10, 2020
If you intend on creating a lot of custom exceptions, I've created an interface and an abstract exception class that ensures that all parts of PHP's built-in Exception class are preserved in child classes. It also properly pushes all information back to the parent constructor ensuring that nothing is lost. This allows you to quickly create new e…
View CustomException.php
<?php
/*
* This code is free software; you can use it, redistribute it, and/or modify as you wish.
* This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY - implied or otherwise.
* This code is distributed "as is." All risk and cost are assumed by the user of the code and not the creator thereof.
* If you wish to give attribution, the original creator is Robert "Nilpo" Dunham (devnilpo@gmail.com)
*/
interface IException
{
@Nilpo
Nilpo / git-pushing-multiple.rst
Created Feb 2, 2019 — forked from KJoke70/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.
View git-pushing-multiple.rst

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@Nilpo
Nilpo / GitHub-Forking.md
Created Apr 24, 2019 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow
View GitHub-Forking.md

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 / animated-favicons.js
Created Oct 11, 2019
Animating Favicons with jQuery
View animated-favicons.js
var favicon_images = [
'http://website.com/img/tmp-0.gif',
'http://website.com/img/tmp-1.gif',
'http://website.com/img/tmp-2.gif',
'http://website.com/img/tmp-3.gif',
'http://website.com/img/tmp-4.gif',
'http://website.com/img/tmp-5.gif',
'http://website.com/img/tmp-6.gif'
],
image_counter = 0; // To keep track of the current image