Skip to content

Instantly share code, notes, and snippets.

View laszlokorte's full-sized avatar

Laszlo Korte laszlokorte

View GitHub Profile
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
@laszlokorte
laszlokorte / gist:760242
Created December 30, 2010 20:18
TinyMCE fix for leaving definition-lists with the enter key
setup : function(ed) {
ed.onKeyPress.addToTop(function(ed, e) {
if(e.keyIdentifier =='Enter' && ed.selection)
{
var element = ed.selection.getNode(),
tagname = element.tagName.toLowerCase(),
contentLength = element.textContent.length;
if( contentLength==0 && (tagname=='dt' || tagname=='dd'))
{
ed.execCommand("formatBlock",false, 'p');

Rails 2.3.5 on App Engine (DataMapper)

Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the TInyDS version also: gist.github.com/gists/269075

Install the Development Environment

<?php
final class VideoBbcode
{
public static function load()
{
// Die ABCodes sollen in die Gruppe video registriert werden
$group = array('video');
<?php
final class ClansphereBbcode
{
private static $cache = array();
public static function load()
{
$base_groups = array('base');
<?php
/*
*
* Secure Class
*
*/
class Secure
{
<?php
class Secure
{
private static $charset = 'utf-8';
/*
*
* Alle HTML-Befehlszeichen aus einem String in HTML-Entities umwandeln
*
*/
<?php
class Bbcode {
const RES_STRING = 0;
const RES_FUNC_OBJECT = 1;
const RES_FUNC_NAME = 2;
const POS_START_KEY = 'start';
private static $patterns = array();
private static $patterns_count=0;
<?php
class ClansphereBbcode {
# alle registered patter
private static $patterns = array();
public static function convert($string, $options = array()) {
$string = self::secure($string);
foreach(self::$patterns AS $pat => $func) {
$string = preg_replace_callback($pat, $func, $string);
<?php
final class VideoAbcode
{
public static function load()
{
// Die ABCodes sollen in die Gruppe video registriert werden
$group = array('video');