Skip to content

Instantly share code, notes, and snippets.

@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / code.gs
Created March 15, 2024 05:48 — forked from jongha/code.gs
Google App Script to insert data(row) to a google spreadsheet via POST
var SHEET_NAME = "Sheet1";
// 2. Run > setup
//
// 3. Publish > Deploy as web app
// - enter Project Version name and click 'Save New Version'
// - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously)
//
// 4. Copy the 'Current web app URL' and post this in your form/script action
//
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / Keywordsforshopping
Created December 23, 2022 04:44 — forked from visar-brainlabs/Keywordsforshopping
Keywords for Google Shopping Campaigns
/**
*
* Exact Match For Shopping
*
* This script reads a list of exact match keywords for Shopping campaigns from a Google Doc,
* and then excludes any search queries from those camapigns if they do not match those keywords.
*
* Version: 1.0
* Google AdWords Script maintained by brainlabsdigital.com
*
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / code-1.cfm
Created December 13, 2022 02:12 — forked from bennadel/code-1.cfm
Making ColdFusion's QueryNew() More Readable
<!--- Create the columns definitions for query new. --->
<cfsavecontent variable="strColumns">
data :: VARCHAR,
rfid :: VARCHAR,
date :: VARCHAR,
time :: VARCHAR,
gross :: VARCHAR,
tare :: VARCHAR,
net :: VARCHAR,
level :: VARCHAR,
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / sys-summit-demo.ps1
Created June 28, 2022 08:41 — forked from potatoqualitee/sys-summit-demo.ps1
dbatools for systems engineers and accidental dbas
break
<#
01. Find instances
02. Connect to instances
03. Check backups
04. Check disk space
05. Perform backups
06. Check for corruption
07. Install maintenance scripts
08. Export all settings for DR
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / React-admin firebase query
Created May 20, 2022 07:41
react-admin perform query search upon firebase database
test("FirebaseClient with filter gte", async () => {
const testDocs = [
{
title: "A",
obj: {volume: 100},
},
{
title: "B",
obj: {volume: 101},
},
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / bing-ads-stats-to-google-sheet.js
Created July 7, 2021 06:56 — forked from krsoninikhil/bing-ads-stats-to-google-sheet.js
Bing Ads Script To Push Campaign Stats To Google Spreadsheet
function main() {
var payload = {"channel": "bing", "reports": []};
var date = new Date();
date.setDate(date.getDate() - 1);
var yesterday = date.toISOString().split('T')[0];
var rows = AdsApp.campaigns().forDateRange('YESTERDAY').withCondition('Impressions > 0').get();
while (rows.hasNext()) {
var campain = rows.next()
var row = campain.getStats();
function deparam(str) {
var o = {};
var reg = /\\?([^?=&]+)(=([^&#]*))?/g;
str.replace(reg, function($0, $1, $2, $3) {
if (typeof $3 == 'string') {
o[decodeURIComponent($1)] = decodeURIComponent($3);
}
});
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / javascript-query-string.js
Created June 7, 2021 11:07 — forked from DavidWells/javascript-query-string.js
JavaScript :: Regex trick: Parse a query string into an object
// http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/
// JavaScript regex trick: Parse a query string into an object
var queryString = {};
anchor.href.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function($0, $1, $2, $3) { queryString[$1] = $3; }
);
// Usage
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / pii_removal_tag.html
Created June 7, 2021 11:06 — forked from SNemzer/pii_removal_tag.html
Custom HTML tag for GTM to strip PII from titles and URLs
<script>
//Extract Parameters into array
function extractParams() {
var urlParams = {},
match,
search = /([^&=]+)=?([^&]*)/g,
query = window.location.search.substring(1);
while (match = search.exec(query)) {
urlParams[match[1]] = match[2];
}
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / attach-listener-to-push-method.js
Created January 16, 2021 18:25 — forked from baybatu/attach-listener-to-push-method.js
Attach event listener to Array push method call
var eventify = function(arr, callback) {
arr.push = function(e) {
Array.prototype.push.call(arr, e);
callback(arr);
};
};
var array = [1,2,3];
eventify(array, function(newArray) {