Skip to content

Instantly share code, notes, and snippets.

View sud0n1m's full-sized avatar

Colin Nederkoorn sud0n1m

View GitHub Profile
import gulp from 'gulp';
import plugins from 'gulp-load-plugins';
import browser from 'browser-sync';
import rimraf from 'rimraf';
import panini from 'panini';
import yargs from 'yargs';
import lazypipe from 'lazypipe';
import inky from 'inky';
import fs from 'fs';
import siphon from 'siphon-media-query';
@sud0n1m
sud0n1m / event.txt
Last active July 20, 2016 21:56
Code to merge in the customer object and event object formatted as valid JSON.
{
"event":
{{ event | replace: "=>", ":" }},
"customer":
{{ customer | replace: "=>", ":" }}
}
{
"description": "What a fancy postcard",
"to": {
"name": "{{ customer.first_name }} {{ customer.last_name }}",
"address_line1": "{{ customer.address_1 }}",
"address_line2": "{{ customer.address_2 }}",
"address_city": "{{ customer.city }}",
"address_state": "{{ customer.State }}",
"address_zip": "{{ customer.zip }}",
"address_country": "US"
// 1. Add this file to a tests directory and name it netflix.js.
// 2. Create a docker container that mounts that directory
// docker run -it -d --name casper2 -v /mnt/user/tests:/tests rdpanek/casperjs bin/bash
// 3. Set up an hourly cron job by creating a new file
// #!/bin/bash
// docker exec casper2 casperjs /tests/netflix.js
// Then add a command to /etc/cron.hourly/speedtest to run this script in the container and chmod +x that file.
var casper = require('casper').create();
casper.options.waitTimeout = 120000;
@sud0n1m
sud0n1m / customer.io_upload.js
Created November 20, 2012 14:13 — forked from nicolasembleton/customer.io_upload.js
Import your customer data with custom parameters into customer.io
//#!/usr/bin/env node
var http = require("http"),
fs = require("fs"),
sys = require('sys'),
exec = require('child_process').exec;
var ENDPOINT="https://app.customer.io/api/v1/customers/";
var SITEID="YOUR SITE ID";
var APIKEY="YOUR API KEY";
<?php if $_SESSION[user] ?>
<script type="text/javascript">
_cio.identify({
// Signed in user attributes
id: <?= $_SESSION[user][id] ?>, // Unique id for the currently signed in user in your application.
email:<?= $_SESSION[user][email] ?>, // Email of the currently signed in user.
created_at:<?= $_SESSION[user][created_at] ?>,
# From the Discourse-Chef directory
SERVER="yourdomain.com"
# Install Instructions
librarian-chef install
# enter your password once and never again
ssh-copy-id root@$SERVER
@sud0n1m
sud0n1m / Capfile
Last active December 13, 2015 18:08
A preliminary capistrano deploy script for discourse. To be used together with https://github.com/sud0n1m/discourse-chef
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'deploy/assets'
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
@sud0n1m
sud0n1m / bootstrap.sh
Last active December 12, 2015 08:59
Bootstrap
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p385.tar.gz
tar -xvzf ruby-1.9.3-p385.tar.gz
cd ruby-1.9.3-p385/
./configure --prefix=/usr/local
make
make install
#!/usr/bin/env bash
apt-get -y update
apt-get -y upgrade
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz
tar -xvzf ruby-1.9.3-p327.tar.gz
cd ruby-1.9.3-p327/
./configure --prefix=/usr/local
make