Skip to content

Instantly share code, notes, and snippets.

View kerinin's full-sized avatar

Ryan Michael kerinin

View GitHub Profile
@kerinin
kerinin / account.rb
Created April 19, 2012 19:43
Context.io account
class Account < ActiveRecord::Base
[
:discovery,
:list_connect_tokens,
:get_connect_token,
:add_connect_token,
:delete_connect_token,
:list_oauth_providers,
:get_oauth_provider,
:add_oauth_provider,
@kerinin
kerinin / message_expiration.rb
Created May 2, 2012 21:45
MessageExpiration
# Stores and retrieves messages to be expired on a given date
#
# Messages can be added, removed, and expired. The actual removal
# of the messages from the user's account is not handled here.
#
class MessageExpiration
attr_reader :eea_id
def inititialize(eea_id)
@eea_id = eea_id
@kerinin
kerinin / mm_pairs.csv
Created August 14, 2012 17:32
Top email sender pairs
vegas_chatter brisbane_times_league_hq
the_dees_nursery brisbane_times_league_hq
the_dees_nursery vegas_chatter
wine_enthusiast wineexpresscom
national_times wa_today_league_hq
toysrus babiesrus
oshkoshbgosh carters
womenshealth prevention
casualmalexl livingxl
mtv nickelodeon
@kerinin
kerinin / after.html
Created September 10, 2012 16:16
Muddle Example
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body style="width: 100% !important; margin: 0; padding: 0; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;">
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tbody>
<tr>
<td valign="top"><h1 style="color: black !important;">Welcome to our AWESOME NEW WEB SERVICE!</h1></td>
</tr>
@kerinin
kerinin / gist:4068172
Created November 13, 2012 20:28
Conditional organization
# Option 1
if eea_exists?
if eea_uses_something?
if eea_ever_used_application?
if eea_currently_uses_application?
recreate_eea; reactivate_application_for_eea; create_session; #13S
else
recreate_eea; reactivate_application_for_eea; create_session; #13S
end
@kerinin
kerinin / gist:4226126
Created December 6, 2012 17:06
HTTP response
/* Handle content. */
while (http.connected())
{
while (http.available() > 0)
{
uint8_t byte = http.read();
if (!success)
Serial.write(byte);
@kerinin
kerinin / stat.ino
Created December 6, 2012 19:48
Parsing Graphite Response
#include <Arduino.h>
String resp;
void setup() {
Serial.begin(9600);
Serial.write("\r\n");
Serial.println("-----------------------");
Serial.println("Arduino Context.IO demo");
void set_color(int color, int redPin, int greenPin)
{
int centrality = abs(128 - color);
int augmentation = floor((128 - centrality) / 5);
analogWrite(redPin, color+augmentation);
analogWrite(greenPin, 255-color+augmentation);
}
context "current user exists, user is not currently using this application" do
# Redirects to Application > Email Addresses, prompts to activate application
end
context "current user exists, user is currently using this application" do
# Redirects to Application > (root)
end
context "no current user, EEA doesn't exist (8L)" do
# Redirects to account_to_found
set default_parallel 12;
sls_watchlist = LOAD 's3://oib-mapreduce-rmichael/sls_watchlist_dumps' AS (
domain: chararray,
subject_line: chararray,
campaign_group: chararray,
mail_campaign_id: chararray,
hour: int
);