Skip to content

Instantly share code, notes, and snippets.

View janxious's full-sized avatar
🌰
.

Joel "The Gregarious" Meador janxious

🌰
.
View GitHub Profile
@janxious
janxious / .mpdconf
Created June 28, 2012 00:54
mpd settings
port "6600"
music_directory "/Users/joel/Music"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
pid_file "~/.mpd/mpd.pid"
state_file "~/.mpd/mpd.state"
audio_output {
type "osx"
name "macchiato"
@janxious
janxious / nmerge.rb
Created February 11, 2012 03:02 — forked from spraints/nmerge.rb
class Hash
def self.nmerge(*hashes, &block)
keys = hashes.map(&:keys).flatten.uniq
rhashes = hashes.reverse
keys.inject({ }) do |output, key|
if block
output[key] = block.call(key, hashes.map{ |x| x[key]})
else
rhashes.each do |hash|
if hash[key]
@janxious
janxious / config-application.rb
Created February 5, 2012 06:30
Y U LOAD RAILS
...
puts "### application loaded ###"
@janxious
janxious / html5.html
Created December 20, 2011 01:28 — forked from mustmodify/html5.html
Attempts to get DocRaptor to render inline SVG images
<!DOCTYPE html>
<html>
<head>
<title>MathML and SVG in text/html</title>
</head>
<body>
<a href="https://developer.mozilla.org/en/Code_snippets/Embedding_SVG">Source</a>
<h1>SVG in text/html</h1>
<p><svg height=86 width=90 viewBox='5 9 90 86' style='float: left;'>
<path stroke=#F53F0C stroke-width=10 fill=#F5C60C stroke-linejoin=round d='M 10,90 L 90,90 L 50,14 Z'/>
@janxious
janxious / rails_project_start_checklist.markdown
Created November 4, 2011 01:38 — forked from codatory/rails_project_start_checklist.markdown
(Ideal) Rails Project Pre-Start Checklist

(Ideal) Rails Project Pre-Start Checklist

Source Control

  • Code is under source control (git) with a remote I can read/write to
  • Do previous developers still have access to the remote? Should they?

Access

  • Do I have SSH access to any staging/production boxes in use?
  • Do previous developers still have access to those? Should they?
  • Do I have granted access to or owner account credentials for any dependent SaaS products or other software?
class Post < ActiveRecord::Base
include Summarizeable
belongs_to :author
alias :body :summarizeable
end
@janxious
janxious / referral-based_document_generation.html
Last active September 26, 2015 06:07
Referral-Based Document Generation Example
<html>
<head>
<title>Referral-based Document!</title>
</head>
<body>
<p>
Here is some sample text. Click the link below to generate a PDF of this page.
<br />
<a href='http://docraptor.com/docs/from_site/?name=example_pdf&strict=none&document_type=pdf'>Referral-based Document Generation Example</a>
</p>
@janxious
janxious / async_ruby_example.rb
Last active September 26, 2015 05:17 — forked from spacetc62/MainWindow.xaml.cs
DocRaptor Examples Set 2 - Ruby
require 'rubygems'
require 'doc_raptor'
TEN_SECONDS = 10
FIVE_MINUTES = 300
DocRaptor.api_key "YOUR_API_KEY_HERE"
pdf_html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en"><body><a href="http://google.com">google</a></body></html>'
@janxious
janxious / DocRaptor.cs
Created June 24, 2011 21:01 — forked from spacetc62/MainWindow.xaml.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";
@janxious
janxious / wrest-example.rb
Created June 20, 2011 04:34
Wrest-based interaction with http://docraptor.com
require 'rubygems'
require 'wrest'
Wrest.logger = Logger.new(STDOUT)
Wrest.logger.level = Logger::DEBUG # Set this to Logger::INFO or higher to disable request logging
response =
'https://docraptor.com/docs?user_credentials=YOUR_API_KEY_HERE'.to_uri.
post_form(:doc =>
{