Skip to content

Instantly share code, notes, and snippets.

View oelmekki's full-sized avatar

kik oelmekki

View GitHub Profile
def index
@status = params[ :status ]
@status = 'all' unless %w(all mine flocks).include?( @status )
page = params[ :page ] || 1
if params[ :category ] and ( category = current_organization.categories.find_by_name( params[ :category ] ) )
blog_posts = category.blog_posts
else
blog_posts = current_organization.blog_posts
end
Class.Mutators.ClassMethods = function( methods ){
this.__classMethods = Object.append( this.__classMethods || {}, methods );
this.extend( methods );
};
Class.Mutators.Extends = function( parent ){
this.parent = parent;
parent.$prototyping = true;
this.prototype = new parent;
delete parent.$prototyping;
" File: php_check.vim
" Author: Olivier El Mekki
" Email: [email protected]
" Description: php syntax checks the buffer
" Usage:
" :PHPCheck - lauch the syntax check
if exists('php_check_plugin')
finish
endif
func Coding_php()
iab <silent> ife if ( )<Left><Left><C-R>=Eatchar('\s')<CR>
iab <silent> functione function ( )<Left><Left><Left><C-R>=Eatchar('\s')<CR>
iab <silent> fore for ( )<Left><Left><C-R>=Eatchar('\s')<CR>
iab <silent> foreache foreach ( )<Left><Left><C-R>=Eatchar('\s')<CR>
iab <silent> switche switch ( )<Left><Left><C-R>=Eatchar('\s')<CR>
iab <silent> whilee while ( )<Left><Left><C-R>=Eatchar('\s')<CR>
" iab <silent> {e {<return>}<return><up><up><esc>A<C-R>=Eatchar('\s')<CR>
iab <silent> LOGe error_log( "" );<Left><Left><Left><Left><C-R>=Eatchar('\s')<CR>
set foldmethod=indent
(function(){
this.Controller = new Class({
Extends: Framework.Controller,
options: {
View: this.View,
events: [
{ el: 'commentField', type: 'focus', view_method: 'expandCommentField' },
{ el: 'commentField', type: 'blur', view_method: 'shrinkCommentField' }
(function(){
this.View = new Class({
Extends: Framework.View,
options: {
selectors: {
'commentField': '#comment_content'
}
},
(function(){
this.Controller = new Class({
Extends: Framework.Controller,
options: {
View: this.View,
events: [
{ el: 'commentField', type: 'focus', view_method: 'expandCommentField' },
{ el: 'commentField', type: 'blur' },
(function(){
this.View = new Class({
Extends: Framework.View,
options: {
selectors: {
'commentField': '#comment_content',
'commentBlock': '#comment_block',
'commentSubmit': { sel: 'input[type="submit"]', within: 'commentBlock' }
}
class DebugLogger < Logger
def format_message( severity, timestamp, progname, msg )
case true
when ( msg.kind_of? Exception )
"#{msg.message}\n#{msg.backtrace.join "\n" }"
when ( msg.is_a? String )
"#{msg}\n"
else
"#{msg.inspect}\n"
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/13-View
default:
javascripts: [/js/javascript.php?set=backend_domains]