Skip to content

Instantly share code, notes, and snippets.

@phillipwilhelm
phillipwilhelm / README.md
Created May 10, 2021 03:57 — forked from sutlxwhx/README.md
Enable RDP and access to the virtual machines for your Proxmox installation

Introduction

This tuturial will help you configure network for your fresh Proxmox istallation.
Be aware that Proxmox configuration was made using this tutorial.

Installation

Backup your current /etc/network/interfaces using this command:

cp /etc/network/interfaces /etc/network/interfaces.backup
@phillipwilhelm
phillipwilhelm / wp_gravity_forms_add_empty_dropdown_option.php
Created March 22, 2021 23:23 — forked from kjbrum/wp_gravity_forms_add_empty_dropdown_option.php
Add a blank option to a Gravity Forms select element.
<?php
/**
* Add a blank option to a Gravity Forms dropdown
*
* @param object $form The Gravity Form
* @return object $form The modified Gravity Form
*/
function wp_gravity_forms_add_empty_dropdown_option( $form ) {
// Select the correct form, then set the id of the field(s) we need to change
if( $form['id'] == 1 ) {
@phillipwilhelm
phillipwilhelm / arrayToTable.php
Created January 25, 2021 07:36 — forked from jakebathman/arrayToTable.php
Make a quick HTML table from a PHP array
function arrayToTable(array $values, array $headers = [])
{
$options = [
'tableStyle' => 'border: 1px solid black;border-collapse: collapse;',
'thStyle' => 'border: 1px solid black;padding: 5px 7px;text-align: center;',
'tdStyle' => 'border: 1px solid black;padding: 5px 7px;text-align: center;',
];
$th = "<th style='" . $options['thStyle'] . "'>";
$td = "<td style='" . $options['tdStyle'] . "'>";
@phillipwilhelm
phillipwilhelm / StateBoundaries.sql
Created January 25, 2021 07:36 — forked from jakebathman/StateBoundaries.sql
The approximate max/min latitude and longitude for all states and major territories
-- Create the table
CREATE TABLE IF NOT EXISTS `StateBoundaries` (
`State` varchar(10) DEFAULT NULL,
`Name` varchar(255) DEFAULT NULL,
`MinLat` varchar(50) DEFAULT NULL,
`MaxLat` varchar(50) DEFAULT NULL,
`MinLon` varchar(50) DEFAULT NULL,
`MaxLon` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@phillipwilhelm
phillipwilhelm / dump.vim
Created January 22, 2021 15:19 — forked from mattn/dump.vim
google-calendar-holiday
scriptencoding utf-8
let s:calendar_list = [
\ ['Australian Holidays', 'en.australian#holiday@group.v.calendar.google.com'],
\ ['Austrian Holidays', 'en.austrian#holiday@group.v.calendar.google.com'],
\ ['Brazilian Holidays', 'en.brazilian#holiday@group.v.calendar.google.com'],
\ ['Canadian Holidays', 'en.canadian#holiday@group.v.calendar.google.com'],
\ ['China Holidays', 'en.china#holiday@group.v.calendar.google.com'],
\ ['Christian Holidays', 'en.christian#holiday@group.v.calendar.google.com'],
\ ['Danish Holidays', 'en.danish#holiday@group.v.calendar.google.com'],
@phillipwilhelm
phillipwilhelm / mysql-cheat-sheet.md
Created January 17, 2021 00:34 — forked from davidsword/mysql-cheat-sheet.md
🔥🍺 MySQL cheat sheet
@phillipwilhelm
phillipwilhelm / geojson.php
Created January 14, 2021 22:48 — forked from wboykinm/geojson.php
Sample PHP to Point GeoJSON
<?php
/**
* PHP GeoJSON Constructor, adpated from https://github.com/bmcbride/PHP-Database-GeoJSON
*/
# Connect to MySQL database
$conn = new PDO('mysql:host=localhost;dbname=mydatabase','myusername','mypassword');
# However the User's Query will be passed to the DB:
$sql = 'SELECT * from GDA_database WHERE user_query = whatever';
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@phillipwilhelm
phillipwilhelm / stripe-checkout.html
Created January 5, 2021 06:42 — forked from ziadoz/stripe-checkout.html
Custom Stripe Checkout Button
<form action="." method="post">
<noscript>You must <a href="http://www.enable-javascript.com" target="_blank">enable JavaScript</a> in your web browser in order to pay via Stripe.</noscript>
<input
type="submit"
value="Pay with Card"
data-key="PUBLISHABLE STRIPE KEY"
data-amount="500"
data-currency="cad"
data-name="Example Company Inc"
@phillipwilhelm
phillipwilhelm / wp-query-ref.php
Created January 4, 2021 16:05 — forked from luetkemj/wp-query-ref.php
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/