Skip to content

Instantly share code, notes, and snippets.

View wikimatze's full-sized avatar
💭
Writing

Matthias Günther wikimatze

💭
Writing
View GitHub Profile
var
TheNameEntered : String;
TheNumberEntered : Integer;
ACounterToUse : Integer;
begin
Write( 'Enter your name: ' );
Readln( TheNameEntered );
Write( 'Enter a number between 1 and 20: ' );
Readln( TheNumberEntered );
@wikimatze
wikimatze / Matthias Günther
Created October 14, 2012 16:46
Three talk proposal from Matthias Günther
# Your first year in Legacy Code
Working in heavy Legacy Code with no structure is challenging. If you really want to improve yourself in such an "hostile" environment,
you need the right tools and strategies.
In this talk I will cover:
- what I learned during my first year working in the IT business.
- big victories against simple
- sometimes you just have to give up
@wikimatze
wikimatze / gist:5417946
Created April 19, 2013 03:31
Confirmation email logic for new user login

Here is the algorithm I'm thinking to implement:

  • We need to add a confirmation_code and confirmation attributes in our user model
  • Create a controller method for our user model that expects a user id and confirmation code, looks up the user, checks the code in the parameter matches the code saved in our Data Base and clears the code after confirmation. In case the user forget his password and/or wants to reset their password we need to recreate this field.
  • Create an action that maps to our new controller method (e.g. /users/1/confirm/code)
  • Create an Mailer template which takes the user as a parameter and use the the confirmation code of the user to send a mail containing a link to the new route in our controller
  • Create an observer for our user model. If the email of the user needs to be modified or a record is created we
@wikimatze
wikimatze / Guardfile
Created May 9, 2013 04:55
Guardfile for Padrino
guard :rspec do
# Padrino example
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/controllers/(.+)\.rb$}) { |m| "spec/app/controllers/#{m[1]}_controller_spec.rb" }
watch(%r{^models/(.+)\.rb$}) { |m| "spec/models/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
end
@wikimatze
wikimatze / gist:5570013
Created May 13, 2013 17:39
Trying to run the test of Padrino-Core
helex@mg: ~/Dropbox/git-repositories/padrino-framework (master ✔) bundle
Resolving dependencies...
Using rake (10.0.4)
Using i18n (0.6.4)
Using multi_json (1.7.3)
Using activesupport (3.2.12)
Using addressable (2.2.8)
Using bcrypt-ruby (3.0.1)
Using bson (1.8.5)
Using bson_ext (1.8.5)
@wikimatze
wikimatze / gist:5648302
Last active December 17, 2015 17:49
Converting text

I want to transform the following text

...
Start with generating a new project with the canonical `padrino` command. In contrast to our "Hello World!" application
(app) before, we are using new options:


{: lang="bash" }
 $ mkdir ~/padrino-projects
@wikimatze
wikimatze / gist:5693804
Created June 2, 2013 15:14
Example of an interactivr shell script
#!/bin/bash
checkParam() {
for PARAM in $*; do
test "${PARAM}" == "-i" && INTERACTIVE=true
test "${PARAM}" == "--interactive" && INTERACTIVE=true
done
}
@wikimatze
wikimatze / ctags.md
Last active April 7, 2022 23:46
Browsing Padrino's Code Base With Ctags in Vim

Working effectively with ctags has always been a topic I missed for a long time because I was too lazy to invest time to learn about the it.

I was working on on my application and was constantly consulting Padrino's API doc in the browser. It would have been more effective if I can do the searching directly the Padrino's code on GitHub. Benefit I don't have to leave the terminal and can focus on my task.

What is ctags

ctags is a tool which make it easy for you to shift through in no time.

@wikimatze
wikimatze / gist:6332795
Last active December 21, 2015 16:19
Bring padrino to the next level

I recently had the pleasure to meet Darío at eurucamp 2013 in wonderful Berlin to discuss issues with the further development of Padrino. Here are the following points we need to think over.

Handling Mailing List

As recently posted on our mailing list with the sql problem, we have problems with some posted activities which are not shown up on the page. Apparently, we I can't find the post anymore which mentioned this issue.

Questions needs to be answered:

  • Who is responsible to admin the presence (checking options, help new members with registration)
  • Should all main contributors have access to the settings?
@wikimatze
wikimatze / gist:7976591
Last active December 31, 2015 10:59
Book review about the book "The Dream Nightmare" by Portia Tung

I won this book in lucky dip at Agile Tour London 2013 from Portia and it was the right book in the right situation. Remember a very desperate team, who was not performing as a team and who was doing wrong estimations, and had a late schedule.

Portias book explained the nightmare, the team went through in a very entertaining and playfull way. In the book, as an Agile Coach, it is up to you which decision you make to rescue a situation which I was facing at. Depending on which actions you take, the consequences will vary and you have to justify on the right decision.

Even if you are doing SCRUM for a couple of years, you will learn something new in the book or detect a common situation you had and see which different options you have and you may use them to act next time in a different way. It is definitely a book you can read perfectly on your way to work. And it will definitely make you smile because you will encounter similar situations at work, but now, you can react in a more appropriate way.