Skip to content

Instantly share code, notes, and snippets.

@phillipwilhelm
phillipwilhelm / hexToCssFilters.ts
Created October 31, 2021 21:52 — forked from dwjohnston/hexToCssFilters.ts
TS Hex to CSS filters solution
//As referenced in this solution
import { number } from "prop-types";
//https://codepen.io/sosuke/pen/Pjoqqp
interface HSL {
h: number;
@phillipwilhelm
phillipwilhelm / split-string-into-rows.sql
Created October 26, 2021 06:56 — forked from duanehutchins/split-string-into-rows.sql
MySQL split comma-separated string into rows
-- split-string-into-rows.sql
-- Duane Hutchins
-- https://www.github.com/duanehutchins
-- Split a string into a mysql resultset of rows
-- This is designed to work with a comma-separated string (csv, SET, array)
-- To use a delimiter other than a comma:
-- Just change all the occurrences of ',' to the new delimiter
-- (four occurrences in SET_EXTRACT and one occurrence in SET_COUNT)
@phillipwilhelm
phillipwilhelm / submit.md
Created September 13, 2021 02:33 — forked from tanaikech/submit.md
Enhanced onEdit(e) using Google Apps Script

Enhanced onEdit(e) using Google Apps Script

onEdit(e) which is used for the Edit event on Spreadsheet has the old value as e.oldValue. The specifications for this are as follows.

  1. When an user edited a single "A1" cell, e of onEdit(e) shows hoge for e.oldValue and fuga for e.value.
  2. When an user edited the "A1:A2" multiple cells, e.oldValue and e.value of onEdit(e) are not shown anything.
  3. When an user copied and pasted from other cell, e.oldValue and e.value of onEdit(e) are not shown anything.

This sample script was created to retrieve both the edited values and the old values for the range of edited cells. This is the modified e.oldValue.

@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';