Skip to content

Instantly share code, notes, and snippets.

@lichtner
lichtner / Article.php
Created November 6, 2012 11:03
Redactor.js nette presenter integration
<?php
class Article extends Base {
function getUploadDir() {
# e.g. something like this
return "upload/articles/article-$this[id]";
}
}
@lichtner
lichtner / row-number.sql
Last active July 11, 2016 15:07
Implement ROW_NUMBER() for mysql, maria if this window functions does not exists
### http://www.mysqltutorial.org/mysql-row_number/
# simple row number
set @row_number = 0;
select (@row_number := @row_number + 1) AS num, id
FROM Term;
# select row number for each group -----------------------------