Skip to content

Instantly share code, notes, and snippets.

Avatar

Karsten Meier handylearn

View GitHub Profile
View strong_methods
# Rake task to help migrating a rails 3 app to rails 4 strong_parameters.
# The task generates source code for helper methods for each model class
# to 'permit' the attributes.
# the generated methods are intended as starting point to copy&paste in the controller
# and than edit the permitted attributs.
# Some common names of non-editable attributes are already filtered,
# like 'id', 'password' or 'created_at'.
# The output is written to stdout so you can pipe it into a file
#
# Dependencies:
View filab_strategy.rb
require 'omniauth-oauth2'
# this OmniAuth-Strategy uses the Keyrock Identity Management
# see http://catalogue.fiware.org/enablers/identity-management-keyrock
# The server url is from the public FIWARE Lab instance.
module OmniAuth
module Strategies
class FilabStrategy < OmniAuth::Strategies::OAuth2
option :name, "filab"
option :client_options, {
@handylearn
handylearn / dependencygraph.rb
Last active Aug 29, 2015
Analyses the header dependencies of C/C++ source directories, this can help to refactor it for faster builds. Orginal version für ruby 1.6/1.8
View dependencygraph.rb
#!/usr/bin/env ruby -w
#
# construct dependency graph for C/C++ projects.
# input is directory with c and h files.
# output as plain text or as dot file for processing with graphviz
#
# Copyright (c) 2004-2015 by Karsten Meier, http://meier-online.com
# This program is free software.
# You can distribute/modify this program under the terms of
# the GNU General Public License version as published by