Skip to content

Instantly share code, notes, and snippets.

View brunoais's full-sized avatar
🎯
Focusing

brunoais brunoais

🎯
Focusing
View GitHub Profile
//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;
'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: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'),
@brunoais
brunoais / proton
Last active May 18, 2024 12:46 — 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...