Skip to content

Instantly share code, notes, and snippets.

View MischaTheEvil's full-sized avatar

Mischa The Evil MischaTheEvil

View GitHub Profile
@MischaTheEvil
MischaTheEvil / development_profiler.rb
Last active December 31, 2015 03:59 — forked from hiltmon/development_profiler.rb
A helper class to support easy ruby-prof profiling in Rails applications.
# encoding: utf-8
#
# Copyright (c) 2012 Hilton Lipschitz
# Copyright (c) 2013 Mischa The Evil
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
@MischaTheEvil
MischaTheEvil / BitNami Tracks Stack Upgrade to Tracks 1.7.1.diff
Created September 9, 2010 02:54
Patch to update Tracks to 1.7.1 in current BitNami Stack
Index: app/controllers/data_controller.rb
===================================================================
--- app/controllers/data_controller.rb (revision 0)
+++ app/controllers/data_controller.rb (working copy)
@@ -18,25 +18,27 @@
def yaml_export
all_tables = {}
- all_tables['todos'] = current_user.todos.find(:all)
+ all_tables['todos'] = current_user.todos.find(:all, :include => [:tags])
===
To GitHub
===
[mischa@server redmine_collapse]# git remote add origin git@github.com:MischaTheEvil/redmine_collapse.git
[mischa@server redmine_collapse]# git push origin --all
Counting objects: 520, done.
Compressing objects: 100% (452/452), done.
Writing objects: 100% (520/520), 74.55 KiB, done.
Total 520 (delta 315), reused 0 (delta 0)
To git@github.com:MischaTheEvil/redmine_collapse.git
@MischaTheEvil
MischaTheEvil / gist:265068
Created December 29, 2009 01:02
0.9-decision_blockers
FEEDBACK?:
http://www.redmine.org/issues/1157#note-15
http://www.redmine.org/issues/4277#note-5
http://www.redmine.org/issues/2755
http://www.redmine.org/issues/3359
CAN BE CLOSED?:
Davide Zipeto wrote:
> Is is possible jsut to write the < pre> tag on a line by disabling temporarly the textile markup engine ? I cannot find any tricks with that...
A neat trick (AFAIK not officially supported by Redmine (nor RedCloth)) can be the use of Redmine's inline code markup.
With a nifty syntax the following results can be achieved: <@pre@>, [@[links]@], <@/code@>, <@/pre@>, <@code@>, @h1.@ and @_italic_@.
I've posted the source of this reply to a gist to easily show the syntax I've used for the examples: <PasteGistURL>.
&nbsp;
REDMINE VERSION SHARING TESTS
Redmine trunk@3129
Role: Manager (which has version-management permission) on ALL projects
* Version TST, not shared, in project: "parent2" "child2-1" "nested2-1-1"
Rails::Plugin.class_eval do
def reloadable!
load_paths.each { |p| Dependencies.load_once_paths.delete(p) }
end
end
reloadable!
@MischaTheEvil
MischaTheEvil / gist:103483
Created April 28, 2009 23:50
Global Menu Renderer helper
# Renders the global menu as an unordered list
# Returns a string containing the HTML for the global menu
def render_global_menu
s = ''
s << "<ul>\n"
# Global issues link
s << "<li>" +
# Add 'alt-selected'-class to the 'a'-element if on global level (!= :controller == issues && != :action == index && != :project_id == nil)
if params[:controller] == 'issues' && params[:action] == 'index' && params[:project_id] == nil
link_to l(:label_issue_view_all), { :controller => 'issues', :id => nil }, :class => 'alt-selected'
@MischaTheEvil
MischaTheEvil / plugin_settings.rhtml
Created April 5, 2009 01:38
Getting a "nested" setting
<p>
<label><%= l(:setting_collapse_menustab) %></label>
<%= check_box_tag 'settings[show_menus_tab]', 1, Setting.plugin_redmine_collapse['show_menus_tab'] == '1', :onclick=>"Element.toggle('menustab_content'); return true;" %><%= hidden_field_tag 'settings[show_menus_tab]', 0 %>
</p>
<div id="menustab_content" <%= Setting.plugin_redmine_collapse['show_menus_tab'] == '1' ? '' : 'style="display:none"' %>>
<p>
<label><%= l(:setting_collapse_pmtab) %></label>
<%= select_tag 'settings[show_projectmenu_tab]', options_for_select( [[l(:general_text_No), "0"], [l(:general_text_Yes), "1"]], @settings ['show_projectmenu_tab'] ) %>
</p>