Skip to content

Instantly share code, notes, and snippets.

View chadjemmett's full-sized avatar

Chad Jemmett chadjemmett

View GitHub Profile
@chadjemmett
chadjemmett / gist:5588991
Created May 16, 2013 02:28
fontvert pathname contains null byte error
Started POST "/target" for 90.229.215.223 at 2013-05-15 20:27:45 -0600
Processing by CheckInputsController#target as */*
Parameters: {"file"=>#<ActionDispatch::Http::UploadedFile:0x007f9cab4c37a0 @original_filename="Skia-Regular.woff", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"file\"; filename=\"Skia-Regular.woff\"\r\nContent-Type: application/octet-stream\r\n", @tempfile=#<File:/var/folders/g0/m3jlqvpd4cbc3khznvn5c_7m0000gn/T/RackMultipart20130515-5063-1k02gby>>, "originalFileName"=>"Skia.ttf"}
WARNING: Can't verify CSRF token authenticity
Completed 500 Internal Server Error in 1ms
ArgumentError (pathname contains null byte):
app/controllers/check_inputs_controller.rb:18:in `initialize'
app/controllers/check_inputs_controller.rb:18:in `new'
app/controllers/check_inputs_controller.rb:18:in `target'
@chadjemmett
chadjemmett / gist:5588849
Created May 16, 2013 01:52
errors from fontvert
Started POST "/target" for 90.229.215.223 at 2013-05-15 19:48:26 -0600
Processing by CheckInputsController#target as */*
Parameters: {"file"=>#<ActionDispatch::Http::UploadedFile:0x007f9ca98975e0 @original_filename="Skia-Regular.ttf", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"file\"; filename=\"Skia-Regular.ttf\"\r\nContent-Type: application/octet-stream\r\n", @tempfile=#<File:/var/folders/g0/m3jlqvpd4cbc3khznvn5c_7m0000gn/T/RackMultipart20130515-5063-1uybosa>>, "originalFileName"=>"Skia.ttf"}
WARNING: Can't verify CSRF token authenticity
Completed 500 Internal Server Error in 1ms
TypeError (can't convert ActionDispatch::Http::UploadedFile into String):
app/controllers/check_inputs_controller.rb:18:in `initialize'
app/controllers/check_inputs_controller.rb:18:in `new'
app/controllers/check_inputs_controller.rb:18:in `target'
require 'unirest'
font_formats = ["otf", "ttf", "svg", "woff"]
font_formats.each do
|format, response|
response = Unirest::post("https://ofc.p.mashape.com/convert/",
{"X-Mashape-Authorization" => "***********************" },
{:file => File.new("Arial.ttf", "rb"),
:format => "#{format}", :callback => "http://aqueous-taiga-8219.herokuapp.com/target"}
)
@chadjemmett
chadjemmett / vimrc
Created April 24, 2013 18:54
My simple vim settings.
" Configuration file for vim
set modelines=0 " CVE-2007-2438
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=2 " more powerful backspacing
set ai " auto indenting
set smartindent " smart indents after something?
@chadjemmett
chadjemmett / true false to yes no in views.
Created April 13, 2013 15:01
A method for rails where you can take a boolean and convert the true false to yes no.
def complete_yes_no
self.complete ? "Yes" : "No"
end
<!DOCTYPE html>
<html>
<head lang="en">
<link text="css/text" rel="stylesheet" href="stylesheet.css"></link>
<meta charset="utf-8">
<title>Custom Plunker</title>
</head>
<div class="center">
<p>Here is a thing too</p>
p {color: red;}
html { background: silver;}
.center {
width: 75%;
height: 100%;
float: center;
background-color: white;
margin-top: -20px;
@chadjemmett
chadjemmett / gist:3758321
Created September 20, 2012 20:58
Why isn't the 'combat' method working?
class Fight
def initialize
Player.new
Monster.new
end #end of the initialize method.
class Player
attr_accessor :ac, :attack, :hp
@chadjemmett
chadjemmett / gist:3493524
Created August 27, 2012 23:54
a ruby timer
timer = Proc.new do
|time, deadline|
time = Time.now
deadline = time + 5
while time != deadline
time = Time.now
end
@chadjemmett
chadjemmett / gist:3201869
Created July 29, 2012 21:15
How to store objects with multiple variables.
class Todo
attr_accessor :item, :done, :time_created
def initialize item_name
#what we need for a new item on the todo list.
#when the item was created.(optional)
@time_created = Time.now
#the string that is displayed that's identified.
@item = item_name
#whether it's done or not