Skip to content

Instantly share code, notes, and snippets.

View marcioAlmada's full-sized avatar
🚀

Márcio Almada marcioAlmada

🚀
View GitHub Profile
# file: /etc/X11/xorg.conf.d/20-intel.conf
# source: https://wiki.archlinux.org/index.php/Intel_Graphics#Choose_acceleration_method
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "uxa"
EndSection
// FileSystem custom file system handler
type FileSystem struct {
fs http.FileSystem
}
// Open opens file
func (fs FileSystem) Open(path string) (http.File, error) {
f, err := fs.fs.Open(path)
if err != nil {
return nil, err
#/etc/X11/xorg.conf
Section "Device"
Identifier "nvidia"
Driver "nvidia"
Option "NoLogo" "true"
Option "DPI" "96 x 96"
# Specify Nvidia PCI device
BusID "PCI:1:0:0"
# Make sure X starts also when no outputs are connected to the Nvidia chip
Option "AllowEmptyInitialConfiguration"
@marcioAlmada
marcioAlmada / fail.txt
Last active June 1, 2017 19:58
😭 The most well tested PHP feature...
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
func_get_arg test [tests/lang/func_get_arg_variation.phpt]
Test wrong number of arguments for flush() (no impact) [tests/output/flush_error_001.phpt]
output buffering - failure [tests/output/ob_014.phpt]
output buffering - failure [tests/output/ob_015.phpt]
Test ob_clean() function : error conditions [tests/output/ob_clean_error_001.phpt]
Test wrong number of arguments for ob_end_clean() [tests/output/ob_end_clean_error_001.phpt]
Test ob_end_flush() function : error conditions [tests/output/ob_end_flush_error_001.phpt]
<?php
use Foo\Bar\{ Foo, Bar, Baz, }; // group use
$array = [1, 2, 3,]; // array
fooCall($arg1, $arg2, $arg3,); // function call arglist
class Foo { // class member lists
const
#!/bin/bash
# Copyright (c) 2011, Michel Alexandre Salim <salimma@fedoraproject.org>
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and its documentation for any purpose, provided that the
# above copyright notice and the following two paragraphs appear in
# all copies of this software.
#
# IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
#!/bin/bash
# Copyright (c) 2011, Michel Alexandre Salim <salimma@fedoraproject.org>
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and its documentation for any purpose, provided that the
# above copyright notice and the following two paragraphs appear in
# all copies of this software.
#
# IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
@marcioAlmada
marcioAlmada / autotest
Last active December 12, 2015 09:59 — forked from erithmetic/autounit
# Prereqs:
# * Ruby
# * gem install watchr
# * gem install rb-inotify
# * pecl install xdebug // in case you want to generate coverage reports
# Usage:
# copy autotest to php project directory
# run watchr autotest
@marcioAlmada
marcioAlmada / opaque_types.php
Created November 17, 2015 01:44
second order macros FTR
--TEST--
Opaque types with macros that generate other macros :>
--FILE--
<?php
macro {
type T_STRING·newtype = T_STRING·basetype;
} >> {
macro { T_STRING·newtype } >> { T_STRING·basetype }
}
callable_arg_type_list:
/* empty */ { $$ = NULL; }
| '(' ')' { $$ = zend_ast_create_list(0, ZEND_AST_PARAM_LIST); }
| T_INT_CAST {
zval zv;
ZVAL_STRINGL(&zv, "int", sizeof("int")-1);
zend_ast *type = zend_ast_create_zval_ex(&zv, ZEND_NAME_NOT_FQ);
zend_ast *arg = zend_ast_create_ex(ZEND_AST_PARAM, 0, type, NULL, NULL);
zend_ast *args = zend_ast_create_list(0, ZEND_AST_PARAM_LIST);
zend_ast_list_add(args, arg);