Skip to content

Instantly share code, notes, and snippets.

View WesleyDRobinson's full-sized avatar
🎚️

Wesley Robinson WesleyDRobinson

🎚️
View GitHub Profile
class Day {
constructor(month, day, year){
this.month = month;
this.day = day;
this.year = year;
}
}
class Tomorrow extends Day {
constructor(month, day, year){
@WesleyDRobinson
WesleyDRobinson / LCS Solutions
Last active September 4, 2015 06:41
Longest Common Subsequence Finder
function longestCommonSubsequence (xString, yString) {
function recur (xString, yString, lcs) {
var xElement = xString.charAt(0);
var yElement = yString.charAt(0);
// Base case --> out of string!
// return the LCS of this section
if (!xElement || !yElement) {
return lcs;
}
@WesleyDRobinson
WesleyDRobinson / wistiaEmbed
Last active October 25, 2019 23:57
Segment interview question :)
<script type="text/javascript">
wistiaEmbed = document.getElementById(“YOUR_IFRAME_ID”).wistiaApi;
wistiaEmbed.bind('play', function () {
analytics.track('play', {
category: 'Video',
label: wistiaEmbed.name()
});
});
wistiaEmbed.bind('pause', function () {
// Event Payload
{
"event": "Slack Testing",
"userId": "loxley1160",
"properties": {
"name": "Robin Hood",
"email": "robin@englandmail.com",
"activities": {
"one": "stealing from the rich",
"two": "giving to the poor"
@WesleyDRobinson
WesleyDRobinson / Shopify Checkout Script
Last active October 25, 2019 23:58
Please see comments for more up to date implementations!!
<script type="text/javascript">
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.1";
window.analytics.load("
@WesleyDRobinson
WesleyDRobinson / Code.gs
Last active June 2, 2016 08:13
Synonyms Sidebar
/**
* Creates a menu entry in the Google Docs UI when the document is opened.
*
* @param {object} e The event parameter for a simple onOpen trigger. To
* determine which authorization mode (ScriptApp.AuthMode) the trigger is
* running in, inspect e.authMode.
*/
function onOpen(e) {
DocumentApp.getUi().createAddonMenu()
.addItem('Start', 'showSidebar')
@WesleyDRobinson
WesleyDRobinson / README.md
Created August 1, 2016 19:00
Connect Kafka

connect-kafka

Connect Segment to Kafka in 5 minutes. Pipe Segment's data sources into your Kafka cluster.

Release: ALPHA

Features

connect-kafka is a simple server that you deploy in your infrastructure. It listens for Segment events and forwards them to the Kafka topic of your choice.

@WesleyDRobinson
WesleyDRobinson / snippet.html
Created May 9, 2017 00:05
segment snippet 4.0.0
<script type="text/javascript">
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="4.0.0";
analytics.load("Y
@WesleyDRobinson
WesleyDRobinson / shameless.md
Created June 1, 2017 04:02
Mitch lays it out

hello newest graduated fullstack class!

here are some shameless plugs.

if you'd like to continue practicing REACTO type questions with the Fullstack alumni network, please join [Fullstack Alumni Slack channel] #reacto_all where you are paired with a new partner each week to practice these type of questions :thumbsup_all: it's a good opportunity to work on your technical interviewing skills and also to network within Fullstack

also here is a google doc i wrote up on what worked for me on my job search. the whole document is a bit long, but the summary of what to do for the technique is short (most of the doc is explaining the strategy). in general, what I found worked best for me was a “shotgun” approach, send out a lot of connections, send out a lot of messages, send out a lot of applications, and do it in as little time as possible, and then go from there. make up for the low hit rate you'll see just by doing big volume. some people prefer a more targeted approach but what I found is that when I moved

@WesleyDRobinson
WesleyDRobinson / context-user-traits.js
Created June 12, 2017 19:32
passing user traits in a track event context object
// protect 'user' methods from invoking before library is available: https://segment.com/docs/sources/website/analytics.js/#ready
analytics.ready(function () {
// retrieve user Traits: https://segment.com/docs/sources/website/analytics.js/#user-group-information
var userTraits = analytics.user().traits();
// invoke Track method: https://segment.com/docs/sources/website/analytics.js/#track
analytics.track('Event Triggered', {eventProp: 1}, {traits: userTraits})
})