Skip to content

Instantly share code, notes, and snippets.

View crtr0's full-sized avatar

Carter Rabasa crtr0

View GitHub Profile
require 'twilio-ruby'
require './creds'
# initialize Twilio client
client = Twilio::REST::Client.new(Creds.ACCOUNT_SID, Creds.AUTH_TOKEN)
# groups all phone numbers based on number of correct answers to trivia questions
pool = [
[3, ["a", "b", "c"]],
[2, ["d", "e", "f"]],
@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;
@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
});
### Keybase proof
I hereby claim:
* I am crabasa on github.
* I am carterrabasa (https://keybase.io/carterrabasa) on keybase.
* I have a public key whose fingerprint is BBF3 AD23 FD40 EC24 1E16 BF9F 4495 F1D3 412F B86B
To claim this, I am signing this object:
@crtr0
crtr0 / jsconfeu_talk_notes.md
Last active August 29, 2015 14:06
Notes for my JSConf EU 2014 talk entitled "A Community of People, Not Projects"

A Community of People, Not Projects

  • Carter Rabasa
  • Developer Evangelist, Twilio
  • JSConf EU 2014

Introduction

Audience poll

  • Show of hands, who here has organized an event that brought developers together?
@crtr0
crtr0 / open_sourcing_community.md
Last active August 29, 2015 14:11
Open Sourcing Community links
using System;
using System.Collections.Generic;
using JWT;
namespace HelloWorld
{
class Hello
{
static void Main()
{
@crtr0
crtr0 / sublevel-test.js
Created August 23, 2015 17:18
Insert a document with a compound key using sublevel, and try to read it out.
var Sublevel = require('level-sublevel')
, Levelup = require('levelup')
, bytewise = require('bytewise')
var db = Sublevel(Levelup('./db', {keyEncoding: bytewise, valueEncoding: 'json'}))
var foo = db.sublevel('foo')
foo.put(['carter', 'rabasa'], {eyes: 'brown'}, function(err) {
foo.createReadStream().on('data', console.log)
@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 / resources.md
Created March 13, 2018 18:30
Financial independence and budgeting resources