Skip to content

Instantly share code, notes, and snippets.

View oelmekki's full-sized avatar

kik oelmekki

View GitHub Profile
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
/**
* TYPOlight webCMS
* Copyright (C) 2005-2009 Leo Feyer
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 2.1 of the License, or (at your option) any later version.
window.addEvent('domready', function() {
var wq = new OVH('domains', 'result');
$('chkdomain').addEvent('click', function( event ){ event.stop(); wq.checkdomain($('domain')); });
});
#!/usr/bin/env ruby
require 'fileutils'
include FileUtils
def usage
puts <<EOS
usage: #{$0} glob-pattern from to
in all files matched by glob-pattern (classical shell
glob pattern), replace from (ruby regex) with to (ruby
substitution for gsub)
<?php
require( dirname( dirname( __FILE__ ) ) . '/lib/sfYaml.php' );
$array = array( 'foo' => 'bar', 'other' => "I'm a bug" );
var_dump( sfYaml::dump( $array ) );
# output :
# string(29) "foo: bar
# other: 'I''m a bug'
# "
$template['default']['regions'] = array(
'header' => array(
'content' => array('<h1>Welcome</h1>','<p>Hello World</p>'),
'name' => 'Page Header',
'wrapper' => '<div>',
'attributes' => array('id' => 'header', 'class' => 'clearfix')
)
);
snippet feature Backend M
# language: fr
Fonctionnalité: Gérer les ${1:ressource}s
Afin de ${2:but}
En tant que ${3:role}
Je dois pouvoir ${4:moyen}
Contexte: je suis loggé en backend
; <<>> DiG 9.7.0-P1 <<>> www.toutfaire.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36905
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 3
;; QUESTION SECTION:
;www.toutfaire.com. IN A
; <<>> DiG 9.7.0-P1 <<>> www.maquette.toutfaire.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44890
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 3
;; QUESTION SECTION:
;www.maquette.toutfaire.com. IN A
function cdm(){
target="$1"
if [[ ! -d $target ]]; then
mkdir -p $target;
fi
cd $target
unset target
}
<?php
class Whatever extends Frontend
{
public function getSomething( $aParam )
{
$template = new FrontendTemplate( 'mod_something' );
$template->aParam = $aParam;
return $template->parse();