Skip to content

Instantly share code, notes, and snippets.

View iNecas's full-sized avatar
💭
Happy hacking 👨 ⌨️ 💻

Ivan Necas iNecas

💭
Happy hacking 👨 ⌨️ 💻
View GitHub Profile
@iNecas
iNecas / 01-disable-ctrl-alt-backspace.conf
Created January 1, 2012 13:02
Disable ctrl-alt-backspace in X11
# Disable ctrl-alt-backpace (restart X11) server.
# Put into /etc/X11/xorg.conf.d
Section "ServerFlags"
Option "DontZap" "yes"
EndSection
@iNecas
iNecas / tmux.conf
Created April 14, 2012 21:57
tmux.conf
unbind C-b
set -g prefix F12
# Use vim-like keys for moving around
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind C-h select-pane -t :-
bind C-l select-pane -t :+
@iNecas
iNecas / .Xresources
Created April 14, 2012 22:03
Xresources for urxvt
*background: black
*foreground: white
xterm*background: #3c3c3c
urxvt*depth: 32
urxvt*background: rgba:1111/1111/1111/ffff
URxvt.scrollBar: false
URxvt.tabbed.tabbar-fg: 4
URxvt.tabbed.tabbar-bg: -1
@iNecas
iNecas / gist:2761470
Created May 21, 2012 09:27
More HEREDOCs at one line
[<<EOS1, <<EOS2, <<EOS3]
This is
an array
EOS1
of very very
very very
EOS2
long strings
EOS3
@iNecas
iNecas / align_indented.rb
Created May 28, 2012 15:08
Align indented
# shift indented text to the left as much as possible
def align_indented(text)
shift_left = text.lines.map { |l| l[/^\s*/].size }.min
text.lines.map { |l| l[shift_left..-1] }.join
end
puts align_indented(<<TEXT)
this is some
indented text
we would like to
@iNecas
iNecas / misused_meta.rb
Created June 27, 2012 20:03
Misusing ruby metaprogramming part I
%w[one two three].each do |method|
define_method method do |*args|
"My uebercool method #{method}"
end
end
@iNecas
iNecas / major_contributor.sh
Created December 4, 2012 13:53
How to become the major contributor to a project
git filter-branch -f --env-filter '
export GIT_AUTHOR_NAME="$ME";
export GIT_COMMITTER_NAME="$ME";
export GIT_AUTHOR_EMAIL="$MY_MAIL";
export GIT_COMMITTER_EMAIL="$MY_MAIL";
' HEAD
git push origin --force
@iNecas
iNecas / hash.java
Last active December 14, 2015 12:49
Surprise: hash function in Ruby returns different values across processes
class Hash {
public static void main(String[] args) {
System.out.println(Integer.toString("Hello World!".hashCode()));
}
}
// $ java Hash
// $ -969099747
// $ java Hash
// $ -969099747
@iNecas
iNecas / fixed_size_keys.rb
Created September 2, 2013 19:25
The moment, when all the string/symbol keys in a hash have the same length
{ :invalid_system => 20,
:invalid_values => 21,
:manifest_error => 22,
:no_answer_file => 23,
:unknown_module => 24,
:defaults_error => 25 }
diff --git a/app/models/katello/concerns/organization_extensions.rb b/app/models/katello/concerns/organization_extensions.rb
index 39a6480..294097d 100644
--- a/app/models/katello/concerns/organization_extensions.rb
+++ b/app/models/katello/concerns/organization_extensions.rb
@@ -19,7 +19,11 @@ module Katello
ALLOWED_DEFAULT_INFO_TYPES = %w(system distributor)
- include ForemanTasks::Concerns::ActionSubject
+ # We need this to be able to scratch build in koji