Skip to content

Instantly share code, notes, and snippets.

View wikimatze's full-sized avatar
💭
Writing

Matthias Günther wikimatze

💭
Writing
View GitHub Profile
@wikimatze
wikimatze / gist:9648491
Last active August 29, 2015 13:57
Deploy Padrino Apps On Anynines

Let's create a new application:

$ padrino g project hello-world-anynines-mysql -d activerecord -a mysql
    create
    create  .gitignore
    create  config.ru
    create  config/apps.rb
    create  config/boot.rb
@wikimatze
wikimatze / SassMeister-input.scss
Created August 18, 2014 05:40
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.0.rc.1)
// ----
// Create a global map of users
$users: ();
// Add a new user to the global map
@mixin user($name, $availability, $infos) {
// ----
// Sass (v3.3.14)
// Compass (v1.0.0.rc.1)
// ----
// Create a global map of users
$users: ();
// Add a new user to the global map
@mixin user($name, $availability, $infos) {
// ----
// Sass (v3.3.14)
// Compass (v1.0.0.rc.1)
// ----
// Create a global map of users
$users: ();
// Add a new user to the global map
@mixin user($name, $availability, $infos) {
@wikimatze
wikimatze / padrino_vs_the_rest.md
Created August 23, 2014 07:22
Draft of the chapter padrino vs the other frameworks
  • Should care about making your decision about the Framework you want to use? There's a lot of folks who insist that people who don't know better should just use Rails for the amount of effort that goes into security in Rails, versus having to know about XSS, CSRF, SQL Injection, etc in Sinatra to add Rack Middleware etc to have those protections ...

  • Is Rails bad?

Many people nowadays say that Rails is bad. But why? The most told problem with is that it is bloated and not easy to learn in the beginning.

@wikimatze
wikimatze / gist:4a7d12cb130c4fbfce15
Created September 24, 2014 20:51
vim-lexical profiles
command -nargs=0 BookEnglisch call lexical#init({
\ 'spell': 1,
\ 'spelllang': ['en_us'],
\ 'dictionary': ['/usr/share/dict/words'],
\ })
command -nargs=0 BookGerman call lexical#init({
\ 'spell': 1,
\ 'spelllang': ['de_20'],
\ 'dictionary': ['~/.vim/spell/gerspchk.dict'],
@wikimatze
wikimatze / vim-book-writing
Created September 27, 2014 12:52
Notes of talk by wikimatze about "Plugins for writing a book with Vim"
## What I need
- Highlight bad words
- fixing grammar
- move text around (folding)
- autocorrection during spelling
- check spelling
- detect repetition and bad grammar
- version control ...
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