Skip to content

Instantly share code, notes, and snippets.

diff --git a/lib/backlogs_project_patch.rb b/lib/backlogs_project_patch.rb
index 229483b..6dea409 100644
--- a/lib/backlogs_project_patch.rb
+++ b/lib/backlogs_project_patch.rb
@@ -16,7 +16,14 @@ module Backlogs
@all_sprints.each{|sprint| sprint.burndown.direction = :up }
days = @past_sprints.collect{|s| s.days.size}.sum
if days != 0
- @points_per_day = @past_sprints.collect{|s| s.burndown.data[:points_committed][0]}.compact.sum / days
+ @points_per_day = @past_sprints.collect{|s|
diff --git a/app/models/rb_issue_history.rb b/app/models/rb_issue_history.rb
index 72e10b9..1af2a44 100644
--- a/app/models/rb_issue_history.rb
+++ b/app/models/rb_issue_history.rb
@@ -296,6 +296,10 @@ class RbIssueHistory < ActiveRecord::Base
def touch_sprint
self.history.select{|h| h[:sprint]}.uniq{|h| "#{h[:sprint]}::#{h[:tracker]}"}.each{|h|
+ unless RbSprint.find_by_id(h[:sprint])
+ puts "#{self.issue.id} was part of non-existent sprint #{h[:sprint]}"
require 'data_mapper'
require 'dm-aggregates'
require 'dm-validations'
DataMapper::Logger.new($stdout, :debug)
#DataMapper.setup(:default, 'sqlite::memory:')
DBNAME = File.expand_path("#{File.dirname(__FILE__)}/.build.sqlite")
File.unlink(DBNAME) if File.exists?(DBNAME)
DataMapper.setup(:default, "sqlite://#{DBNAME}")
@retorquere
retorquere / tree-dnd.rb
Created January 31, 2013 00:50
Tree drag and drop
#!/usr/bin/env jruby
require 'jrubyfx'
java_import 'javafx.scene.control.TreeCell'
class MyTreeCell < TreeCell
def updateItem(item, empty)
super(item, empty)
text = item unless item
Exception running Application:
#<NameError: no constructorfor arguments (org.jruby.RubyString,javafx.stage.Stage) on Java::JavafxSceneControl::TreeItem>
c:/jruby-1.7.2/lib/ruby/gems/shared/bundler/gems/jrubyfx-792ff9cbb74d/lib/jrubyfx/fxml_module.rb:92:in `build'
c:/jruby-1.7.2/lib/ruby/gems/shared/bundler/gems/jrubyfx-792ff9cbb74d/lib/jrubyfx/dsl.rb:176:in `method_missing'
c:/jruby-1.7.2/lib/ruby/gems/shared/bundler/gems/jrubyfx-792ff9cbb74d/lib/jrubyfx/dsl.rb:109:in `method_missing'
c:/jruby-1.7.2/lib/ruby/gems/shared/bundler/gems/jrubyfx-792ff9cbb74d/lib/jrubyfx/core_ext/tree_view.rb:36:in `method_missing'
c:/jruby-1.7.2/lib/ruby/gems/shared/bundler/gems/jrubyfx-792ff9cbb74d/lib/jrubyfx/core_ext/tree_view.rb:28:in `tree_item'
tree_view.rb:189:in `start'
org/jruby/RubyBasicObject.java:1691:in `instance_eval'
c:/jruby-1.7.2/lib/ruby/gems/shared/bundler/gems/jrubyfx-792ff9cbb74d/lib/jrubyfx/fxml_module.rb:49:in `with'
require 'win32ole'
require 'time'
require 'pp'
class OLFolder
Calendar = 9
end
GUID = '{F1716EB1-CF14-48D9-95DF-51ECC8E1D27C}'
session = WIN32OLE.new("Redemption.RDOSession")
@retorquere
retorquere / gist:6061516
Created July 23, 2013 10:50
Scannable link translator
{
"translatorID": "da66877b-35be-4578-b11b-58a302c535ec",
"label": "Scannable Links",
"creator": "Emiliano Heyns",
"target": "html",
"minVersion": "2.1.9",
"maxVersion": "",
"priority": 50,
"inRepository": false,
"translatorType": 2,
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://zotero-better-bibtex/skin/overlay.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://zotero-better-bibtex/locale/zotero-better-bibtex.dtd">
<overlay id="zotero-better-bibtex-preferences"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefwindow id="zotero-prefs">
<prefpane id="zotero-prefpane-better-bibtex"
insertafter="zotero-prefpane-advanced"
#!/bin/bash
set -x
case $1 in
setup)
echo SETUP
rm -rf .gnome2 .cache .config
mkdir -p ~/.gnome2/keyrings/
echo default >~/.gnome2/keyrings/default
!config
# Pull bibliography from zotero as part of build
# author: Emiliano Heyns
# last edited by: eeh, Dec 2nd 2013
# requires arara 3.0+
#
# Sample usage
#
# % arara: zoterobib
# % arara: zoterobib: {format: biblatex}