Skip to content

Instantly share code, notes, and snippets.

View jamesasu's full-sized avatar

James Angus jamesasu

View GitHub Profile
<?php
// Wordpress Themes built with Sage (http://roots.io)
// These actions will dequeue all junk CSS and JS that plugins attempt to include in your theme:
function dequeue_doubleup_styles() {
wp_dequeue_style('minimax-bootstrap');
wp_dequeue_style('module-styles');
wp_dequeue_style('wp-color-picker');
wp_dequeue_style('row-styles');
wp_dequeue_style('fa');
@jamesasu
jamesasu / gulpfile.js
Last active August 29, 2015 14:17
How to create inline JavaScript lazypipe function for custom file processing
var collapseSrc = function(file) {
return lazypipe()
.pipe(function(){
return through.obj(function(file, enc, cb) {
var contentTypes = {
".png": "image/png",
".gif": "image/gif",
".jpg": "image/jpeg",
".jpeg": "image/jpeg",
".bmp": "image/bmp",
var username = process.env.USERNAME; // See selenium.env
var authkey = process.env.PASSWORD;
var webdriver = require('selenium-webdriver'),
SeleniumServer = require('selenium-webdriver/remote').SeleniumServer,
request = require('request');
var remoteHub = "http://" + username + ":" + authkey + "@hub.crossbrowsertesting.com:80/wd/hub";
var browsers = [
SELECT
MobileMessageTrackingID,
EID,
MID,
Mobile,
MessageID,
KeywordID,
CodeID,
ConversationID,
CampaignID,
<script runat="server">
Platform.Load("Core", "1");
var api = new Script.Util.WSProxy();
try {
var cols = [ "ContactId", "Email" ];
var data = api.retrieve("DataExtensionObject[TEST SMS Info Capture]", cols);
<script runat=server>
Platform.Load("core", "1.1.1");
var accessToken = {{yourToken}};
var url = 'https://www.exacttargetapis.com/asset/v1/content/assets/{{ContentID}}'
var payload = '{{yourPayload}}';
var auth = 'Bearer ' + accessToken;
utm_source=SFMC&utm_medium=Email&UTM_campaign=%%emailname_%%&UTM_content=%%emailname_%%_%%jobid%%&UTM_Term=%%linkname%%
global void finish(Database.BatchableContext BC){
enableTriggers();
}
global static void enableTriggers() {
toggleTriggers(true);
}
@jamesasu
jamesasu / Talend-tLoop-tRest.txt
Created July 8, 2020 05:36
Use the current iteration number from the tLoop to get each page from an API endpoint.
context.Domain +"/api/myEndpoint?page=" + ((Integer)globalMap.get("tLoop_1_CURRENT_ITERATION"))
@jamesasu
jamesasu / bigquery-dedupe.sql
Created August 18, 2020 00:08
Use window functions to remove duplicate rows
-- Use window functions to remove duplicate rows:
SELECT * EXCEPT(row_number)
FROM (
SELECT
Email,
ROW_NUMBER() OVER (PARTITION BY Email) row_number
FROM Dataset.Emails
)
WHERE row_number = 1