Skip to content

Instantly share code, notes, and snippets.

var Engine = {
json: function(jsonresp, wapp) {
var jsonp = wapp.router.params.callback;
jsonresp = jsonp ? (jsonp + "(" + JSON.stringify(jsonresp) + ")") : JSON.stringify(jsonresp);
jsonresp = unescape(encodeURIComponent(jsonresp)); // Encode to UFT-8
var headers = [("Content-Type: application/" + (jsonp ? "javascript" : "json") + "; charset=utf-8")]
return({body: jsonresp, headers: headers});
},
html: function(jsonresp, wapp, controller, action) {
var file = "views/" + controller.replace("Controller", "") + "/" + action
➜ kanbanpad git:(task-851) rake heroku\[create\]
! App not found.
Creating a new heroku app: kanbanpad-task-851
Pushing branch
! Your key with fingerprint 24:73:ed:88:8f:f2:fe:95:68:88:a3:5b:fd:31:db:2a is not authorized to access kanbanpad-task-851.
fatal: The remote end hung up unexpectedly
Looks like we're done. Yay!
require 'redcarpet'
class CustomRender < Redcarpet::Render::HTML
def list_item(text, list_type)
case text
when /\[\s?x\s?\]/
"<li><input type='checkbox' value='true' checked>#{text.gsub(/\[\s?x\s?\]/, "").strip}</li>\n"
when /\[\s?\]/
"<li><input type='checkbox' value='false'>#{text.gsub(/\[\s?\]/, "").strip}</li>\n"
else
"<li>#{text}</li>\n"
$('.viewingtask').droppable
accept: '.color-swatch'
tolerance: 'touch'
over: -> #when you hover over it lightens up
$(this).addClass('lighten')
out: -> #when you hover out it goes back to normal
$(this).removeClass('lighten')
greedy: true
drop: (e, ui) ->
if ui.helper.hasClass('color-swatch')
def self.format_lead_time(dates_ago, project)
daily_lead_time = []
zero_lead_time = []
weekly_lead_time = []
upper = []
medium = []
lower = []
clear = []
colors = {:blue => [], :brown => [], :green => [], :orange => [], :red => [], :yellow => [], :purple => []}
a = 7 - dates_ago.cwday
class ApplicationController < ActionController::Base
protect_from_forgery
def index
@users = User.all
render :template => "applications/index"
end
def current_user
@current_user ||= warden.authenticate(:scope => :user)
development:
sessions:
default:
database: <%= ENV["OAUTH_ENV"] %>-plataforma
hosts:
- localhost:27017
options:
test:
sessions:
default:
#task-subtask{:style => ((task.sub_tasks.count > 0 || params[:edit] == "true") ? "display:block" : "display: none"), :class => (params[:edit] == "true" ? "edit" : "normal") }
- if task.creator.id == current_user.id
.actions
%a.delete_subtask{:href => "#"}
%a.edit_subtask{:href => "#"}
%ol
- if params[:edit] == "true"
- task.sub_tasks.each do |x|
%li{:id => x.id.to_s}
.drag
it 'should take a step when told' do
@step.tasks.create(:title => 't1', :project_id => @project.id)
@step.tasks.create(:title => 't2', :project_id => @project.id)
@step.tasks.create(:title => 't3', :project_id => @project.id)
@step.tasks.count.should == 3
put @project.path(:task => @step.tasks[0]) + '/step.json', 'task[target]' => @project.steps[3]._id.to_s
class PlataformaRegistrationsController < DeviseController
prepend_before_filter :require_no_authentication, :only => [ :new, :create, :cancel ]
prepend_before_filter :authenticate_scope!, :only => [:edit, :update, :destroy]
# GET /resource/sign_up
def new
resource = build_resource({})
app_id = session[:user_return_to].match(/client_id=(\w+)/)[1]
application = Doorkeeper::Application.where(:uid => app_id).first
respond_with resource, :layout => application.name