Skip to content

Instantly share code, notes, and snippets.

View brunoais's full-sized avatar
🎯
Focusing

brunoais brunoais

🎯
Focusing
View GitHub Profile
@brunoais
brunoais / README.md
Last active September 19, 2021 15:12
[Tutorial] PlayOnLinux: Run command line programs while keeping work dir

PlayOnLinux: Run command line programs while keeping work dir

Intro

For this demo, I will provide an example on how to run pingo (image compressor) as a command line program with the help of PlayOnLinux.

Pingo doesn't really need the benefits of PlayOnLinux but other programs may.

In this case, I wanted to use a specific wine version which is not the default in my system and because pingo is very simple to install and have (just a self-conntained executable) it's easier to demonstrate and show how to do.

@brunoais
brunoais / proton
Last active November 8, 2024 04:09 — forked from thingsiplay/proton
Proton script
#!/bin/bash
# Execute Windows programs with Proton from Steams installation folder, without
# starting Steam client.
#
# 1. Create a directory for Proton environment to run in. As an example make a
# folder "proton" in your home directory. This folder must exist in order
# to make Proton work.
#
# 2. Point the variable "env_dir" in this script to that folder or...
(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 August 29, 2015 14:19
generated javascript
(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 August 29, 2015 14:01 — forked from nickvergessen/gist:752b6b54eedc76c793f3
Alternative for phpBB dbal for more explicit table joins
<?
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'),
'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 April 14, 2014 15:15
my forumlist_body.html
<!-- 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 -->
@brunoais
brunoais / gist:10654807
Created April 14, 2014 14:47
twig error
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 April 14, 2014 14:03
phpBB synphony fatal error
Fatal error: Class 'Symfony\Component\HttpKernel\DependencyInjection\Extension' not found in \phpBB\phpbb\di\extension\config.php on line 21
//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;