Skip to content

Instantly share code, notes, and snippets.

@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / Application.cfc
Created January 4, 2021 10:51 — forked from christierney402/Application.cfc
CF: Using "Access-Control-Allow-Origin" header in ColdFusion CFScript #snippet
component {
boolean function onRequestStart( required string targetPage ) {
var headers = getHttpRequestData().headers;
var origin = '';
var PC = getpagecontext().getresponse();
// Find the Origin of the request
if( structKeyExists( headers, 'Origin' ) ) {
;(function(u){
/**
* @desc Map your OneTrust tag IDs here to Tealium Template IDs found in utag.loader.cfg object like this:
* @param "OneTrust_tag_id": "Tealium_tid",
* @return You can add more lines to suit your tag library in both tools
*/
// Begin Config
var oneTrustTagIdToTealiumTemplateIdConfig = {
"81878": "7110", // e.g.: Google Analytics
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / brokenlinks.js
Created October 5, 2020 09:26 — forked from robinwo/brokenlinks.js
Find broken links (AdWords)
function() {
return function(model) {
var globalSendTaskName = '_' + model.get('trackingId') + '_sendHitTask';
// Hook the sendHitTask - grab an original reference to a function
var originalSendTask = window[globalSendTaskName] = window[globalSendTaskName] || model.get('sendHitTask');
model.set('sendHitTask', function(sendModel) { //overwrite sendHitTask with our code
var hitPayload = sendModel.get('hitPayload');
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / dataLayerHistory.js
Created May 22, 2020 07:55 — forked from sahava/dataLayerHistory.js
JavaScript for persisting dataLayer array and data model composition across pages
(function() {
// Set the timeout for when the dataLayer history should be purged. The default is 30 minutes.
// The timeout needs to be in milliseconds.
var timeout = 30*60*1000;
// Change dataLayerName only if you've defined another named for the dataLayer array in your
// GTM container snippet.
var dataLayerName = 'dataLayer';
// Don't change anything below.
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / GoogleAnalyticsReportingSample.java
Created May 18, 2020 11:48 — forked from LindaLawton/GoogleAnalyticsReportingSample.java
Sample for the Google Analytics reporting API with java
import com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp;
import com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver;
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets;
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.util.store.DataStoreFactory;
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / import_json_appsscript.js
Created September 24, 2017 07:35 — forked from chrislkeller/import_json_appsscript.js
Adds what amounts to an =ImportJSON() function to a Google spreadsheet... To use go to Tools --> Script Editor and add the script and save.
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / Groovy.sublime-build
Created September 22, 2017 15:59
Sublime Text 3 build system for groovy
{
"shell_cmd": "groovy \"${file}\"",
"selector": "*.groovy",
"working_dir": "${file_path}",
"file_regex": "[ ]*at .+[(](.+):([0-9]+)[)]"
}
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / intellij-monokai-theme.xml
Created June 5, 2017 10:09 — forked from darekkay/intellij-monokai-theme.xml
Monokai Theme for JetBrains IDEs (IntelliJ IDEA, Webstorm, PhpStorm, PyCharm etc.)
<scheme name="Eclectide Monokai" version="142" parent_scheme="Default">
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="EDITOR_FONT_NAME" value="Consolas" />
<colors>
<option name="ADDED_LINES_COLOR" value="295622" />
<option name="ANNOTATIONS_COLOR" value="b2c0c6" />
<option name="CARET_COLOR" value="bbbbbb" />
<option name="CARET_ROW_COLOR" value="" />
<option name="CONSOLE_BACKGROUND_KEY" value="1c1c1c" />
<option name="FILESTATUS_ADDED" value="629755" />
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / Pull-and-Sync-Data-Between-Google-Doc-Spreadsheet-and-MySQL.gs
Created May 22, 2017 08:54
You can pull data from MySQL database to Google doc spreadsheet auto with just click of a button or scheduled time. This is great use for retrieving data in spreadsheet format.
// MySQL to Google Spreadsheet By Pradeep Bheron
// Support and contact at pradeepbheron.com
function myMySQLFetchData() {
var conn = Jdbc.getConnection('jdbc:mysql://127.0.0.1:3306/employee_db', 'username', 'pass'); // Change it as per your database credentials
var stmt = conn.createStatement();
var start = new Date(); // Get script starting time