Skip to content

Instantly share code, notes, and snippets.

View crtr0's full-sized avatar

Carter Rabasa crtr0

View GitHub Profile
@crtr0
crtr0 / client.js
Created June 8, 2012 17:02
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@crtr0
crtr0 / gist:4197945
Created December 3, 2012 20:54
Decoding some JSON data in our Mustache template
var data = "{{ voteoptions }}";
var voting_string = data.unescapeHtml();
var voting = JSON.parse(voting_string);
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
@crtr0
crtr0 / devrel_faq.md
Last active December 31, 2019 10:52
Developer Evangelism FAQ

Q: What are the specific goals of developer relations?

There's no simple answer here, but I like to think of developer advocacy/evangelism/relations/etc as an extension of one (or more) of your company's core functions: product, sales, marketing and support. When I was a developer evangelist at Twilio, my team supported the Marketing org, so the team goals aligned with Marketing goals (driving signups).

Often you'll encounter a team of "Developer Advocates". The Google Chrome org has a team of Developer Advocates for example. These folks tend to align more with the Product organization, and their goals/metrics likewise align with the broader goals/metrics of the Product org.

Q: How do you measure it?

You can use the baseline metrics associated with your functional groups (i.e. top of funnel signups for Marketing) and then layer on metrics that capture the impact that the team is having in isolation from the overall organization. Example: developers who signed-up for your product because an evangelist

---
pagination:
data: talks
size: 1
alias: talk
permalink: "talks/{{ talk.title | slug }}/"
tags: ???
title: ???
layout: layout
---
@crtr0
crtr0 / TypeText.js
Last active March 25, 2019 16:59
React component for typing out words (uses Hooks)
import { useState, useEffect } from 'react'
// wordList is expected to be an array
const TypeText = ({ wordList }) => {
const words = wordList
const [text, setText] = useState(null)
let wordIndex = 0
let typingIndex = 0
let timer
@crtr0
crtr0 / resources.md
Created March 13, 2018 18:30
Financial independence and budgeting resources
@crtr0
crtr0 / main.js
Created November 9, 2017 21:46
GH OAuth callback in StdLib
/**
* Function to handle a Github OAuth callback
* https://developer.github.com/apps/building-integrations/setting-up-and-registering-oauth-apps/about-scopes-for-oauth-apps/
* @param {string} code Required. The code you received as a response to Step 1.
* @param {string} state The unguessable random string you provided in Step 1.
* @returns {string}
*/
module.exports = (code, state, context, callback) => {
const axios = require('axios')
axios.post('https://github.com/login/oauth/access_token', {
@crtr0
crtr0 / domains.js
Last active December 19, 2015 21:59
var d = domain.create();
d.on("error", function(error) {
// handle it
});
d.run(function() {
// deeply nested and possibly async code
});
@crtr0
crtr0 / sample.mm
Last active December 19, 2015 06:39 — forked from kwhinnery/sample.mm
#pragma mark * UIView methods
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Synchronous networking on the main thread is seriously bad - only doing this for
// demo purposes
NSURL* url = [NSURL URLWithString:@"https://your-domain.azurewebsites.net/capability"];
NSURLResponse* response = nil;