Skip to content

Instantly share code, notes, and snippets.

View BrandonMathis's full-sized avatar
🌸
me like code

BrandonMathis BrandonMathis

🌸
me like code
View GitHub Profile
@BrandonMathis
BrandonMathis / FirstApp.coffee
Last active October 3, 2015 04:48
Meteor Blogpost
root = global ? window
if root.Meteor.isClient
root.Template.hello.greeting = ->
"Welcome to FirstApp."
root.Template.hello.events = "click input": ->
alert "You pressed the button"
@BrandonMathis
BrandonMathis / gist:2662675
Created May 11, 2012 22:04
Refinery fail at root_url
Started GET "/" for 127.0.0.1 at 2012-05-11 18:00:38 -0400
Processing by Refinery::PagesController#home as HTML
Parameters: {"locale"=>:en}
Refinery::Role Load (0.3ms) SELECT "refinery_roles".* FROM "refinery_roles" WHERE "refinery_roles"."title" = 'Refinery' LIMIT 1
Refinery::User Load (0.5ms) SELECT "refinery_users".* FROM "refinery_users" INNER JOIN "refinery_roles_users" ON "refinery_users"."id" = "refinery_roles_users"."user_id" WHERE "refinery_roles_users"."role_id" = 1
Refinery::Page Load (0.3ms) SELECT "refinery_pages".* FROM "refinery_pages" WHERE "refinery_pages"."link_url" = '/' LIMIT 1
Refinery::Page Load (0.2ms) SELECT "refinery_pages".* FROM "refinery_pages" WHERE "refinery_pages"."menu_match" = '^/404$' LIMIT 1
Rendered public/404.html (0.0ms)
Filter chain halted as :find_page rendered or redirected
Refinery::User Load (0.3ms) SELECT "refinery_users".* FROM "refinery_users" WHERE "refinery_users"."id" = 1 LIMIT 1
EVERE: Application Error
org.jruby.rack.RackInitializationException: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
from /var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/execjs-1.4.0/lib/execjs.rb:5:in `ExecJS'
from /var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/execjs-1.4.0/lib/execjs.rb:4:in `(root)'
from org/jruby/RubyKernel.java:1038:in `require'
from /var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/execjs-1.4.0/lib/execjs.rb:68:in `require'
from org/jruby/RubyArray.java:1602:in `each'
from /var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `require'
from org/jruby/RubyArray.java:1602:in `each'
from /var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `require'
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
# Multistaging for production and staging servers
set :default_stage, "staging"
set :stages, %w(production staging websphere)
require 'capistrano/ext/multistage'
require "bundler/capistrano"
require "rvm/capistrano"
file_list # has the fill path to each file here in an array (maybe use pathmap)
file_list.map! { |path| get_filename(path) } # some pathmap magic here
class_list = []
file_list.each { |file| class_list << get_classes_from_file(file) }
class_list.each do |class_name|
@BrandonMathis
BrandonMathis / Gemfile
Created August 23, 2012 13:54
Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.2'
gem 'pg'
gem 'thin'
gem 'ipsum'
group :assets do
gem 'haml'
gem 'sass-rails', '~> 3.2.3'
@BrandonMathis
BrandonMathis / flash.erb
Created August 27, 2012 21:00
Flash box
<% flash.each do |name, msg| %>
<%= content_tag :div, msg, :class => "flash_#{name}" %>
<p><%= msg %></p>
<% end %>
@BrandonMathis
BrandonMathis / server.xml
Created September 21, 2012 18:08
Tomcat server setup
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@BrandonMathis
BrandonMathis / error.log
Created September 24, 2012 15:47
Tomcat thread error
INFO: Stopping service Catalina
Sep 24, 2012 11:24:04 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [ReferenceReaper] but has failed to stop it. This is very likely to create a memory leak.
Sep 24, 2012 11:24:04 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [] created a ThreadLocal with key of type [org.jruby.RubyEncoding$2] (value [org.jruby.RubyEncoding$2@1236360d]) and a value of type [org.jruby.RubyEncoding.UTF8Coder] (value [
org.jruby.RubyEncoding$UTF8Coder@251698d2]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Sep 24, 2012 11:24:04 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [] created a ThreadLocal with key of type [org.joni.StackMachine$1] (value [org.joni.StackMachine$1@6e8b1603]) and a valu
@BrandonMathis
BrandonMathis / GetHeroes.json
Created September 29, 2012 04:23
Github Wiki API Responses
{
"result": {
"heroes": [
{
"name": "npc_dota_hero_antimage",
"id": 1,
"localized_name": "Anti-Mage"
},
{