Skip to content

Instantly share code, notes, and snippets.

brunoais brunoais

Block or report user

Report or block brunoais

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View twig.twig.js
(function($, window, document, undefined) { // Avoid conflicts with other libraries
var xslt = xslt('{{xslt}}');
{% for bbcode in BBCODES}
$.sceditor.plugins.bbcode.bbcode.set('{{bbcode.name}}',
{
tags: {
{% for containerTag in bbcode.containerTags}
'{{containerTag}}': {
'data-tag-id': "{{bbcode.tagId}}"
@brunoais
brunoais / long data.js
Last active Aug 29, 2015
generated javascript
View long data.js
(function($, window, document, undefined) { // Avoid conflicts with other libraries
xslt = xslt('<?xml version="1.0"?>' +
'<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">' +
' <xsl:param name="defaulted"/>' +
' <xsl:param name="content"/>' +
' <xsl:param name="size"/>' +
' <xsl:param name="L_WROTE"/>' +
' <xsl:param name="author"/>' +
' <xsl:param name="type"/>' +
' <xsl:param name="L_IMAGE"/>' +
@brunoais
brunoais / gist:e02f5724c41c94962eff
Last active Aug 29, 2015 — forked from nickvergessen/gist:752b6b54eedc76c793f3
Alternative for phpBB dbal for more explicit table joins
View gist:e02f5724c41c94962eff
<?
array(
/** ... **/
'FROM' => array(
ONE_TABLE => '1',
TWO_TABLES => array('2', '3'),
ONE_ON_TABLE => array('4' => array('2' =>'4.case = 2.case'),
TWO_ON_TABLES => array(
'5' => array('2' => '5.case = 2.case'),
'6' => array('3' => '6.case = 3.case'),
View gist:61559f62963e0a760003
'FROM' => array(
ONE_TABLE => '1',
TWO_TABLES => array('2', '3'),
ONE_ON_TABLE => array('4' => '4.case = 2.case',
TWO_ON_TABLES => array(
'5' => '5.case = 2.case',
'6' => '6.case = 3.case',
),
),
@brunoais
brunoais / gist:10657241
Created Apr 14, 2014
my forumlist_body.html
View gist:10657241
<!-- BEGIN forumrow -->
<!-- IF (forumrow.S_IS_CAT and not forumrow.S_FIRST_ROW) or forumrow.S_NO_CAT -->
</ul>
</div>
</div>
<!-- ENDIF -->
<!-- EVENT forumlist_body_category_header_before -->
View gist:10654807
Uncaught exception 'Twig_Error_Syntax' with message 'Unexpected tag name "endif" (expecting closing tag for the "for" tag defined near line 3) in "forumlist_body.html" at line 88'
@brunoais
brunoais / gist:10650977
Created Apr 14, 2014
phpBB synphony fatal error
View gist:10650977
Fatal error: Class 'Symfony\Component\HttpKernel\DependencyInjection\Extension' not found in \phpBB\phpbb\di\extension\config.php on line 21
View addEventListener-polyfill.js
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence : Improved by brunoais
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
// There are events IE does not support. This will translate those to the best option available
switch(on){
case 'DOMContentLoaded': on = 'load';
break;
@brunoais
brunoais / loadingjQueryAsync(minified).html
Created Feb 1, 2013
This is a commented example code about adding jQuery in an async way. As long as you don't use jQuery stuff outside the fake ready() or in functions/methods that are called before the ready() method, all works without any modifications. Tested on IE 7+, FF 3.6+, Chrome 24, Opera 12.
View loadingjQueryAsync(minified).html
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">(function(a,c,d){function b(b,c){"ready"==b?a.bindReadyQ.push(c):a.readyQ.push(b)}a.readyQ=[];a.bindReadyQ=[];var e={ready:b,bind:b};a.$=a.jQuery=function(a){if(a===c||a===d)return e;b(a)}})(window,document);function jQOk(){var a=jQuery,c=document;a.each(readyQ,function(c,b){a(b)});a.each(bindReadyQ,function(d,b){a(c).bind("ready",b)})} function jQErr(){var a=document.createElement("script");a.type="text/javascript";a.src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js";a.async=!1;a.defer=!1;a.onload=jQOk;document.getElementsByTagName("head")[0].appendChild(a)};</script>
<script async type="text/javascript"src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"onload="jQOk()"onerror="jQErr()"></script>
<!--[if lte IE 8]><script type="text/javascript">if("undefined"==typeof jQuery.fn){jQErr();var interval=setInterval(function(){jQOk();clearInterval(interval)},100);setTimeout(function(){clearInterval(interval)},12E3)};</sc
@brunoais
brunoais / input
Created Dec 14, 2012
parsing example
View input
[b child="0"]
[u child="0,1"]
[b child="0,1,0"]
[/b]
[/u]
[/b]
[b child="1"]
another bold
[b child="1,0"]
[/b]
You can’t perform that action at this time.