Skip to content

Instantly share code, notes, and snippets.

View script_Bing.js
/**
* @name Week spend by Campaign
*
*
*/
const credentials = {
accessToken: '',
clientId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
clientSecret: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
@phillipwilhelm
phillipwilhelm / docker-volumes.md
Created September 14, 2022 16:38 — forked from onlyphantom/docker-volumes.md
Demystifying Docker Volumes for Mac and PC Users
View docker-volumes.md

Demystifying Docker Volumes for Mac and PC Users

  1. Docker runs on a Linux kernel

Docker can be confusing to PC and Windows users because many tutorials on that topic assume you're using a Linux machine.

As a Linux user, you learn that Volumes are stored in a part of the host filesystem managed by Docker, and that is /var/lib/docker/volumes. When you're running Docker on a Windows or Mac OS machine, you will read the same documentation and instructions but feel frustrated as that path don't exist on your system. This simple note is my answer to that.

When you use Docker on a Windows PC, you're typically doing one of these two things:

  • Run Linux containers in a full Linux VM (what Docker typically does today)
@phillipwilhelm
phillipwilhelm / noduplicates.sql
Created September 9, 2022 06:29 — forked from salvatorecapolupo/noduplicates.sql
WordPress find post duplicates via MySQL query - Used to remove duplicated posts from WordPress - i.e https://www.lipercubo.it, https://capolooper.it
View noduplicates.sql
SELECT a.ID, a.post_title, a.post_type, a.post_status
FROM wp_posts AS a
INNER JOIN (
SELECT post_title, MIN( id ) AS min_id
FROM wp_posts
WHERE post_type = 'post'
AND post_status = 'publish'
GROUP BY post_title
HAVING COUNT( * ) > 1
) AS b ON b.post_title = a.post_title
@phillipwilhelm
phillipwilhelm / Email-verifier.js
Created August 11, 2022 20:20 — forked from augfrank/Email-verifier.js
Google Sheet script to verify email addresses automatically
View Email-verifier.js
/**
* A custom function that verifies an email ID
*
* @param {String} email ID
* @return {Boolean} If the email ID is active
* @customfunction
*/
function verifyEmail(email) {
// Replace this with your Hunter.io API key
@phillipwilhelm
phillipwilhelm / note.txt
Created August 7, 2022 18:16 — forked from rksk/note.txt
MySQL: Logging table changes into another table using triggers
View note.txt
This is related to the blog post: https://medium.com/p/5215c77083e5
@phillipwilhelm
phillipwilhelm / submit.md
Created June 16, 2022 06:53 — forked from tanaikech/submit.md
Letting Users Running Google Apps Script on Google Spreadsheet without both Authorizing Scopes and Showing Script
View submit.md

Letting Users Running Google Apps Script on Google Spreadsheet without both Authorizing Scopes and Showing Script

This is a sample workaround for letting users running Google Apps Script on Google Spreadsheet without both authorizing the scopes and showing the script.

The flow of this workaround is as follows.

  1. Create Web Apps created by Google Apps Script and deploy it as Web Apps. As the returned value, the XML data is returned.
    • Your script can be included in this script.
  2. User put a formula of =IMPORTML("WebApps URL", "xpath") to a cell.
@phillipwilhelm
phillipwilhelm / exportSpreadsheet.gs
Created June 16, 2022 06:23 — forked from Spencer-Easton/exportSpreadsheet.gs
Example on how to export a Google sheet to various formats, includes most PDF options
View exportSpreadsheet.gs
function exportSpreadsheet() {
//All requests must include id in the path and a format parameter
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export
//FORMATS WITH NO ADDITIONAL OPTIONS
//format=xlsx //excel
//format=ods //Open Document Spreadsheet
//format=zip //html zipped
@phillipwilhelm
phillipwilhelm / custom google apps scripts for tech sales
Created June 16, 2022 06:17 — forked from nvahalik/custom google apps scripts for tech sales
Some Google Apps Script functions for Spreadsheets which might be useful for those in Technical Sales or software development. They can be used to add up and manipulate hour ranges (e.g. SUMRANGE(["1-2",2,"2-5"]) would yield "5-9"). Those functions are SUMRANGE, SUMRANGEHIGH, SUMRANGELOW, RANGEMULT, and RANGEADD. There are also some functions wh…
View custom google apps scripts for tech sales
/* Grab the values and make them globally available. */
var hoursPerDay = 8;
var hoursPerWeek = hoursPerDay * 5;
/**
* We calculate the number of hours in a given range.
*/
function SUMTIME(allData) {
var numHours = 0;
var numCells = allData.length;
@phillipwilhelm
phillipwilhelm / gist:e2edabad1d5c7a811e8e8547b15acb07
Created June 1, 2022 16:45 — forked from filipbec/gist:5998034874b119fab0e4
Scannr - Keys for obtaining US Driver's license data
View gist:e2edabad1d5c7a811e8e8547b15acb07