Skip to content

Instantly share code, notes, and snippets.

@nozpheratu
nozpheratu / gist:4534493
Created January 14, 2013 23:21
My Aloha Page
<script data-aloha-plugins="common/ui,common/format,common/highlighteditables,common/link,common/image,common/align,common/table,common/horizontalruler,extra/headerids,common/list,extra/metaview,common/abbr,extra/formatlesspaste,common/characterpicker,common/contenthandler,custom/videoembed" src="/assets/aloha/aloha-full.js"></script>
<div id="aloha"></div>
<script>
//<![CDATA[
Aloha.ready( function() {
Aloha.settings.contentHandler.insertHtml = [ 'word', 'generic', 'sanitize', 'videoembed' ];
Aloha.settings.contentHandler.sanitize = {
// elements allowed in the content
var Aloha = window.Aloha || ( window.Aloha = {} );
Aloha.settings =
{
contentHandler: {
insertHtml: ['word', 'generic', 'oembed', 'sanitize', 'videoembed'],
sanitize: "relaxed",
allows: {
// elements allowed in the content
elements: [
'a', 'abbr', 'b', 'blockquote', 'br', 'cite', 'code', 'dd', 'del', 'dl', 'dt', 'em',
rake aborted!
No such file or directory - /assets/mercury/mercury.css
(in /home/robot/.rvm/gems/ruby-1.9.3-p0/gems/mercury-rails-0.9.0/app/assets/stylesheets/_mercury-sass.scss)
/home/robot/.rvm/gems/ruby-1.9.3-p0/gems/less-rails-2.2.6/lib/less/rails/import_processor.rb:24:in `read'
/home/robot/.rvm/gems/ruby-1.9.3-p0/gems/less-rails-2.2.6/lib/less/rails/import_processor.rb:24:in `block in depend_on'
/home/robot/.rvm/gems/ruby-1.9.3-p0/gems/less-rails-2.2.6/lib/less/rails/import_processor.rb:17:in `each'
/home/robot/.rvm/gems/ruby-1.9.3-p0/gems/less-rails-2.2.6/lib/less/rails/import_processor.rb:17:in `depend_on'
/home/robot/.rvm/gems/ruby-1.9.3-p0/gems/less-rails-2.2.6/lib/less/rails/import_processor.rb:11:in `evaluate'
/home/robot/.rvm/gems/ruby-1.9.3-p0/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
/home/robot/.rvm/gems/ruby-1.9.3-p0/gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
##Userable
module Userable
def self.included(base)
base.has_one :user, :as => :userable, :dependent => :destroy, :autosave => true
base.validate :user_must_be_valid
base.alias_method_chain :user, :autobuild
base.extend ClassMethods
base.define_user_accessors
end
$CLASSPATH << "/bin/Sikuli-IDE/"
require "sikuli-script.jar"
java_import 'org.sikuli.script.Region'
java_import 'org.sikuli.script.Screen'
java_import 'org.sikuli.script.Settings'
java_import 'org.sikuli.script.SikuliEvent'
java_import 'org.sikuli.script.SikuliScript'
#Crome X30 Y109
@nozpheratu
nozpheratu / seeds.rb
Created March 21, 2013 16:53
seed file for country/state creation
# encoding: utf-8
Country.delete_all
ActiveRecord::Base.connection.reset_pk_sequence!('countries')
Country.create(:id=>1,:iso=>"AD",:name=>"Andorra")
Country.create(:id=>2,:iso=>"AE",:name=>"United Arab Emirates")
Country.create(:id=>3,:iso=>"AF",:name=>"Afghanistan")
Country.create(:id=>4,:iso=>"AG",:name=>"Antigua and Barbuda")
Country.create(:id=>5,:iso=>"AI",:name=>"Anguilla")
Country.create(:id=>6,:iso=>"AL",:name=>"Albania")
Country.create(:id=>7,:iso=>"AM",:name=>"Armenia")
@nozpheratu
nozpheratu / gist:8445614
Created January 15, 2014 22:01
Twitter Bootstrap Mail Interface
<table class="table table-condensed table-hover">
<thead>
<tr>
<th class="span1"><input type="checkbox"></th>
<th class="span2"></th>
<th class="span2"></th>
<th class="span9"></th>
<th class="span2"></th>
</tr>
</thead>
require "sikulix"
require "rspec"
def image(file_name)
"#{Dir.pwd}/images/#{file_name}"
end
describe "UI" do
include SikuliX4Ruby
@nozpheratu
nozpheratu / matchmaking.js.jsx
Last active August 29, 2015 14:04
In this gist I'm trying to get the PlayerForm to receive the new players state as it gets updated in the MatchList component.
// Example eliminations.json to generate match data
// [
// {
// "id":223,
// "competition_id":2,
// "home_id":2,
// "away_id":9,
// "round":1,
// "home_name":"nicolas_badila",
// "away_name":"thedarkship4"
@nozpheratu
nozpheratu / exhibit.rb
Created August 23, 2014 18:00
Exhibit class
require "delegate"
class Exhibit < SimpleDelegator
include Pundit
def self.exhibits
[
RegistrationExhibit,
EliminationExhibit,