Skip to content

Instantly share code, notes, and snippets.

View Jaballadares's full-sized avatar

John Balladares Jaballadares

View GitHub Profile
@ciaranmahoney
ciaranmahoney / Google Sheets MX Lookup
Last active October 22, 2024 23:22
Google Apps Script to Run MX Lookups on domains from Google Sheets
function MXLookup(domain) {
try {
var url = "https://dns.google.com/resolve?name=%FQDN%&type=MX".replace("%FQDN%",domain);
//var url = "https://dns.google.com/resolve?name=e-mercy.com&type=MX"; // USED FOR TESTING ONLY
Utilities.sleep(100);
var result = UrlFetchApp.fetch(url,{muteHttpExceptions:true});
var rc = result.getResponseCode();
@verticalgrain
verticalgrain / app.js
Last active April 26, 2022 15:37
React Router V4 Redirect after form submission
import React, { Component } from 'react'
import { Redirect } from 'react-router'
export default class ContactForm extends Component {
constructor () {
super();
this.state = {
fireRedirect: false
}
}
<?php
/**
* Gravity Wiz // Gravity Forms // Rename Uploaded Files
*
* Rename uploaded files for Gravity Forms. You can create a static naming template or using merge tags to base names on user input.
*
* Features:
* + supports single and multi-file upload fields
* + flexible naming template with support for static and dynamic values via GF merge tags
*
@iambrianreich
iambrianreich / google-reviews.php
Last active November 12, 2021 21:02
Use the Google Places API to render a Google My Business reviews badge on a WordPress site using shortcodes.
<?php /** @noinspection SpellCheckingInspection */
/**
* This file contains the WordPress code for rendering a Google Reviews badge.
*
* Usage:
*
* 1. Create a Google API Console account if you have not already done so.
* 2. Register for the Google Places API.
* 3. Create an API key.
* 4. Ensure that the API key can be used from wherever this script will execute
@nyancodeid
nyancodeid / README.md
Last active April 29, 2025 08:20
Make RESTful API with Google Apps Script and SpreadSheet

Google Script CRUD

By Ryan Aunur Rassyid

Simply create RESTful API with Google Script and store it to Google SpreadSheet like a Pro.

@azanli
azanli / Email_Scraper.js
Last active February 6, 2024 20:45
An email scraper for websites - extracts names and emails from a page & inserts them into your Google Spreadsheet for Mail Merge
class Email_Scraper {
constructor(log = false, names = true, scriptURL = '', spreadsheetURL = '') {
this.currIndex = 0;
this.log = log;
this.names = names;
this.pendingRecursive = 1;
this.scriptURL = scriptURL;
this.spreadsheetURL = spreadsheetURL;
this.sourceIndex = 0;
this.sources = {};
@donmccurdy
donmccurdy / csv-processing.js
Created October 31, 2018 20:45
example CSV transformation in Node.js
const fs = require('fs')
const csv = require('csv');
fs.createReadStream('data.csv')
.pipe(csv.parse({columns: true}))
.pipe(csv.transform((input) => {
return Object.assign({}, input, {
foo: input['foo'].toUpperCase()
});
}))
@amjad
amjad / json_sync_acf_fields.php
Last active October 1, 2021 09:42 — forked from superpositif/jp_sync_acf_fields.php
Automatically update Advanced Custom Fields field groups via JSON
<?php
/**
*
* Function that will automatically remove ACF field groups via JSON file update
*
*/
function acf_auto_suppr($json_dirs) {
$groups = acf_get_field_groups();
if (empty($groups)) {
@akrantz
akrantz / Custom Function SUM().EXCEL.yaml
Last active April 25, 2022 08:02
Implement the SUM() function in JavaScript.
name: Custom Function SUM()
description: Implement the SUM() function in JavaScript.
host: EXCEL
api_set: {}
script:
content: |
/**
* The sum of all of the numbers.
* @customfunction
* @param number1 A number (such as 1 or 3.1415), a cell address (such as A1 or $E$11), or a range of cell addresses (such as B3:F12).
@sperand-io
sperand-io / worker.js
Last active October 28, 2023 09:41
Cloudflare Workers / Segment Smart Proxy — serve data collection assets and endpoints from your own domain
/**
* Steps to use:
* 1. Create CF Worker, copy and paste this in
* 2. (Optional) Update configuration defaults
* - If you want to manage in code, do so below under "Static Configuration"
* - If you want dynamic custom config: Create CFW KV namespace, link them, and add reference below
*
* - You can overwrite default path prefix for loading analytics.js (<yourdomain>/ajs)
* (corresponding KV entry: `script_path_prefix`)
* - You can overwrite default path prefix for handling first-party data collection (<yourdomain>/data)