Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@illbzo1
illbzo1 / The Tomb of Unfathomable Horror
Created October 16, 2011 21:50
Text-based Dungeon Adventure
# creates an empty array for the user's inventory
@inventory = []
# this is the command prompt method
def prompt()
print "Enter command > "
end
# shows a list of viable commands when a user enters "help" at the command prompt
def help()
@illbzo1
illbzo1 / aan
Created November 10, 2011 02:37
Random Phrase Generator
files = Dir.glob("*.txt")
adjective_list1 = IO.readlines("adj1.txt")
adjective_list2 = IO.readlines("adj2.txt")
noun_list = IO.readlines("noun.txt")
prefix_list = IO.readlines("prefix.txt")
suffix_list = IO.readlines("suffix.txt")
rand1 = rand(adjective_list1.length)
rand2 = rand(adjective_list2.length)
@illbzo1
illbzo1 / nodejs_example.js
Created June 9, 2015 18:54
An example Node.js implementation for DocRaptor, that does not rely on any external dependencies.
var https = require("https"),
fs = require("fs");
var payload = JSON.stringify({
user_credentials: "YOUR_API_KEY_HERE",
doc: {
document_content: "<!DOCTYPE html><html><head><title>Javascript PDF Sample</title></head><body>Hello from Javascript!</body></html>",
name: "test.pdf",
document_type: "pdf",
test: true
@illbzo1
illbzo1 / curl_example_excel.sh
Created August 14, 2012 19:05
DocRaptor Examples Set 3 - Simple Curl Commands
#This simple Curl example will create a sample test Excel file with the authentication information as part of the POST data. All you have to do is copy this code, plug in your API key, and paste it into a command line.
curl -H "Content-Type:application/json" -d'{"user_credentials":"YOUR_API_KEY_HERE", "doc":{"name":"docraptor_sample.xls", "document_type":"xls", "test":"true", "document_content":"<table><tr><td>Example!</td></tr></table>"}}' http://docraptor.com/docs > docraptor_sample.xls
@illbzo1
illbzo1 / async_excel_ruby_example.rb
Created August 14, 2012 17:21 — forked from janxious/async_ruby_example.rb
DocRaptor Examples Set 2 - Ruby
require 'rubygems'
require 'doc_raptor'
TEN_SECONDS = 10
FIVE_MINUTES = 300
DocRaptor.api_key "YOUR_API_KEY_HERE"
xls_html = "<table name='My First Sheet'><tr><td>Cell 1</td><td>Cell 2</td></tr></table>"
@illbzo1
illbzo1 / DocRaptor.cs
Created August 14, 2012 17:09 — forked from janxious/DocRaptor.cs
DocRaptor Examples Set 1 - Non-Ruby
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Web;
namespace DocRaptorConsoleExample {
class DocRaptor {
private const string PostFormat = "doc[{0}]={1}&doc[name]={2}&doc[document_type]={3}&doc[test]={4}";
private const string ApiKey = @"YOUR API KEY HERE";
@illbzo1
illbzo1 / dc.rb
Created December 31, 2011 02:39
Dungeon Crawler full
require 'sinatra'
not_found do
halt 404, 'Shit\'s busted.'
end
get '/input' do
@input = params[:input]
case params[:input]
when "go north"
@illbzo1
illbzo1 / Example code
Created December 22, 2011 03:48
Still working on Dungeon Crawler redirection
# trying to set a method so I can use @input in other methods
class Input
def initialize(input)
@input = params[:input]
end
end
# collecting the input with a form here
get '/input' do
@input = params[:input]
@illbzo1
illbzo1 / An example of the form method from a view
Created December 14, 2011 02:33
Working with form methods in Sinatra
<form method="get" action="/input">
<input type="text" name="input" />
<input type="submit" value="Submit" />
</form>