Skip to content

Instantly share code, notes, and snippets.

View Thanatermesis's full-sized avatar

Thanatermesis Thanatermesis

View GitHub Profile
@Thanatermesis
Thanatermesis / patch subgroups redmine
Created June 13, 2013 01:44
This is an old patch for redmine to create subgroups feature, not works in recent redmine's
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index db56eff..06f9284 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -106,33 +106,33 @@ class GroupsController < ApplicationController
end
end
- def add_users
+ def add_principals
@Thanatermesis
Thanatermesis / indentings mixed
Created March 26, 2014 20:05
This is a (not working) demo file about a problem with the automated indenting
#!/bin/bash
source /usr/lib/elive-tools/functions
main(){
# pre {{{
local disk partition
# ways to get partitions:
# lsblk -f
# /proc/partitions
num, F6, F7, kpDiv, kpMul, F10, power,
lpo2l2, caret, kp7, kp8, kp9, kpSub, volumeU,
bkslash, kp4, kp5, kp6, kpAdd, volumeD,
lpupo3l3, asterisk, kp1, kp2, kp3, kpEnter, mute,
kp0, transp, kpDec, kpEnter, transp,
def find_keyword(m)
@keywords.keys.map{|keyword|
Regexp.new(keyword).match(m.message)
}.compact.sort_by{|matchdata|
matchdata.begin(0)
}.each{|matchdata|
m.reply @keywords[matchdata[0]]
}
end
@keywords.each do |k,v|
Regexp.new(k, Regexp::IGNORECASE).match(m.message) do |r|
# give her some humanity
# this is supposed to say: ( words * 60 ) / words-per-minute
delayed_answer = ( ( v.split.size * 60 ) / 120 ).to_f
# add 3 more seconds of humanity
delayed_answer = delayed_answer + 3
#m.reply delayed_answer
# wait and...
#!/usr/bin/env ruby
# -- encoding: utf-8 --
require "selenium-webdriver"
require "rspec"
require "rspec-expectations"
Selenium::WebDriver::Firefox::Binary.path='/usr/bin/iceweasel'
$profile = Selenium::WebDriver::Firefox::Profile.new
images {
image: "foto.jpg" LOSSY 80;
image: "texto-1.png" LOSSY 90;
image: "texto-2.png" LOSSY 90;
}
collections{
group {