Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Gotow bengotow

View GitHub Profile
@bengotow
bengotow / pong.rb
Created Aug 22, 2014
Ping back and forth between two email accounts over and over forever using Inbox
View pong.rb
#!/usr/bin/env ruby
require 'inbox'
@inbox_careless = Inbox::API.new('xdfim6g4mbduytzjhn8ud490', '80q785tt4l6qn5g07c5ylwi6a', '<<token 1>>')
@inbox_emoink = Inbox::API.new('xdfim6g4mbduytzjhn8ud490', '80q785tt4l6qn5g07c5ylwi6a', '<<token 2>>')
emoink = @inbox_emoink.namespaces.first
careless = @inbox_careless.namespaces.first
while true do
View gist:131e51f30155efe5bd42
### Keybase proof
I hereby claim:
* I am bengotow on github.
* I am bengotow (https://keybase.io/bengotow) on keybase.
* I have a public key whose fingerprint is 74AB 1024 E78C 6F3A 12F1 D92C C034 F07C CC52 32D1
To claim this, I am signing this object:
@bengotow
bengotow / server.py
Last active Aug 29, 2015
A simple implementation of the authorization flow for Inbox. Presents a sign in page, and then displays the first message from the user's inbox once they've signed in.
View server.py
#!/usr/bin/env python
# NOTE: This sample app does NOT use SSL. Before deploying this code to a
# server environment, you should ENABLE SSL to avoid exposing your API
# access token in plaintext.
# To run this demo app:
# 1. Save this file to your computer as `server.py`
#
# 2. In the Inbox Developer Portal, create a new application. Replace the
@bengotow
bengotow / gist:9433828
Created Mar 8, 2014
Objective-C convenience methods for abstracting timing dependency
View gist:9433828
- (void)example
{
NSTextView * console = [self xcodeConsoleIn: IDEWindow];
NSInteger baseLength = [[console string] length] + [command length];
[_log appendFormat: @"\n Writing into console: %@", command];
[console insertText: command];
[console insertNewline:nil];
@bengotow
bengotow / RubyMotion_Setup.md
Last active Dec 17, 2015
Living document with information about adding the Spark Inspector framework into a RubyMotion project
View RubyMotion_Setup.md

###Add the Spark Inspector to a RubyMotion Project

Please give these instructions a try and let me know how it goes - it should be possible to get the Spark Inspector working. I don't own a copy of RubyMotion yet, but I identified the vendor_project options I think you'll need to include and link the Inspector's framework into your app.

UPDATE: @tbdr has confirmed that the instructions below work. Feel free to comment below if you discover issues!

UPDATE 2: @tbdr has published a gem motion-sparkinspector to make this easier. Source available https://github.com/TBD/motion-sparkinspector.

  1. Download the Spark Inspector from http://www.sparkinspector.com/
View namespace.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html version="XHTML+RDFa 1.1" xmlns="http://www.w3.org/1999/xhtml"
prefix="xhv: http://www.w3.org/1999/xhtml/vocab#
xsd: http://www.w3.org/2001/XMLSchema#
rdfs: http://www.w3.org/2000/01/rdf-schema#
dc: http://purl.org/dc/terms/
vcard: http://www.w3.org/2006/vcard/ns#
v: http://rdf.data-vocabulary.org/#"
lang="en" >