Skip to content

Instantly share code, notes, and snippets.

View hennevogel's full-sized avatar
🍻
Ewiger Feierabend

Henne Vogelsang hennevogel

🍻
Ewiger Feierabend
View GitHub Profile
diff --git a/src/api/config/routes.rb b/src/api/config/routes.rb
index 66861c4..3127aea 100644
--- a/src/api/config/routes.rb
+++ b/src/api/config/routes.rb
@@ -281,7 +281,7 @@ OBSApi::Application.routes.draw do
get 'user/autocomplete' => :autocomplete
get 'user/tokens' => :tokens
- post 'user/do_login' => :do_login
+ post 'user/do_login' => :do_login, constraints: cons
diff --git a/src/api/config/routes.rb b/src/api/config/routes.rb
index 66861c4..7383057 100644
--- a/src/api/config/routes.rb
+++ b/src/api/config/routes.rb
@@ -263,7 +263,7 @@ OBSApi::Application.routes.draw do
post 'user/register' => :register
get 'user/register_user' => :register_user
- get 'user/login' => :login
+ get 'user/login' => :login, constraints: cons
@hennevogel
hennevogel / gist:8845867
Last active August 29, 2015 13:56
oSC14 plash page launched
oSC14 plash page launched. bootstrap
@hennevogel
hennevogel / OSEM Youtube Script
Created July 17, 2014 09:52
This is a script to batch assign youtube video IDs to OSEM event GUIDs
#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
mapping = {
"kVYMYCvraFSdnKu_qEugfg" => "jFrqHgk2258",
"5vA7x02ejJY2hfGs3tmA8w" => "dpzVjFuKwyo" }
mapping.each do |guid, yid|
event = Event.find_by_guid(guid)
def get_registrations_per_week
result = []
reg = registrations.group(:week).count
result = calculate_items_per_week(21, 6, reg)
end
result
end
roles = %w(participant admin organizer)
users = %w(hans fred fritz)
conferences = %w(osc13 dsp14 lala)
roles.each do |role|
users.each do |user|
conferences.each do |conf|
if role == "organizer" || role == 'admin'
puts "YO YO YO"
else
@hennevogel
hennevogel / keybase.md
Created October 23, 2014 10:29
keybase.md

Keybase proof

I hereby claim:

  • I am hennevogel on github.
  • I am henne (https://keybase.io/henne) on keybase.
  • I have a public key whose fingerprint is 0008 8762 102E 19D1 DE7F EFEA 9D61 64C2 955F ADE0

To claim this, I am signing this object:

Distributing Free Software: Herding Cats

Herd of cats No rights reserved by KUSHI

The basic challenge of distributing Free Software is compiling that awesome open source code into machine code for different Linux distributions so it's easily consumable for users. Sounds simple, but it isn't. If you look at the dependencies of a typical Free Software project you will find thousands of other projects in the stack. They build on top of each other, have functional dependencies, sometimes they are interdependent, they conflict with each other and what not. In short: Building Free Software is like herding cats. And rightfully users of the software expect a steady, well behaved, streamlined herd of cats! The Open Build Service (OBS) is the tool which makes this possible, it helps Free Software distributors to **automatically and consi

module ActiveRecord
module Scoping
class ScopeRegistry # :nodoc:
def self.value_for(scope_type, variable_name)
instance.value_for(scope_type, variable_name)
end
def self.set_value_for(scope_type, variable_name, value)
instance.set_value_for(scope_type, variable_name, value)
@hennevogel
hennevogel / omg.rb
Last active November 25, 2015 15:51
def get_build_flags
build_flags = Hash.new
build_flags['all'] = Array.new
flag = main_object.flags.with_repositories(nil).with_architectures(nil).first
if flag
build_flags['all'] << flag
else
build_flags['all'] << main_object.flags.new( flag: 'build', status: Flag.default_state('build') )
end