Skip to content

Instantly share code, notes, and snippets.

View carlsednaoui's full-sized avatar

Carl Sednaoui carlsednaoui

View GitHub Profile
// Create result object, where everything will get saved
var result = '';
// create the headers
result += 'campaign name, sent on, emails sent, marked as spam, unsubscribes, bounced, suppressed, opened, clicked, converted';
result += '\n';
// get the name of the campaign
result += $($('.cio-page-header__title')[0]).text().replace('\n', '').replace(',', '-').trim();
@carlsednaoui
carlsednaoui / scrape-cio.js
Created November 9, 2015 15:53
Get stats from Customer.io
// Create result object, where everything will get saved
var result = '';
// create the headers
result += 'campaign name, status, created, updated, failed, sent, opened, clicked, converted';
result += '\n';
// loop over each row
$('tbody tr').each(function(i, el) {
@carlsednaoui
carlsednaoui / MailinatorAliases
Last active July 1, 2024 23:37 — forked from nocturnalgeek/MailinatorAliases
A list of alternate domains that point to @mailinator.com
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
@carlsednaoui
carlsednaoui / optimizely.js
Created March 5, 2014 22:53
Optimizely for Angular
window.myInterval = setInterval(function() {
if ($(SELECTOR).length > 0) {
OPTIMIZELY CHANGES
clearInterval(window.myInterval);
}
}, 50);
@carlsednaoui
carlsednaoui / vertical-align.css
Created February 1, 2014 05:58
CSS - Vertical Align
/*http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/*/
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"jshint": {
(function getABTest() {
var abTestName = '',
abTestVariation = '',
abTest = 'No test',
abTestExperiments = optimizely.allExperiments[Object.keys(optimizely.variationMap)];
if (abTestExperiments) {
abTestVariation = Object.keys(optimizely.variationNamesMap).map(function(el) { return optimizely.variationNamesMap[el]; })[0];
abTestName = abTestExperiments.name;
abTest = abTestName + ': ' + abTestVariation;
@carlsednaoui
carlsednaoui / js_map_and_reduce_from_scratch.js
Created July 9, 2013 16:48
Create Map and Reduce from scratch in JS.
Array.prototype.reduce = function(fn, acc) {
if (acc === undefined && this.length !== 0)
return this.slice(1).reduce(fn, this[0]);
if (this.length === 0) return acc;
return this.slice(1).reduce(fn, fn(acc, this[0]));
};
@carlsednaoui
carlsednaoui / simple_timer.js
Last active December 17, 2015 03:59
Simple JS timer created for GA class.
// $(document).ready(function() {
// var counter = timer(90); // time in seconds
// var status = "active";
// function timer(count) {
// var intervalID = setInterval(function() {
// $('.timer').text(status + ": " + count);
// count -= 1;
// if (count <= 0 && status == "active") {
@carlsednaoui
carlsednaoui / createElement.js
Created April 30, 2013 22:17
Without jQuery, it elegantly creates an element with attributes.
function createElement(type, attrs) {
return Object.keys(attrs).reduce(
function(el, n) { el[n]=attrs[n]; return el; },
document.createElement(type)
);
}
What does it do? Without jQuery, it elegantly creates an element with attributes.
createElement('a', {