Skip to content

Instantly share code, notes, and snippets.

View romanodesouza's full-sized avatar

Romano de Souza romanodesouza

  • Belo Horizonte, Brazil
View GitHub Profile
@romanodesouza
romanodesouza / actionlist.vim
Created March 22, 2017 13:10 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
/*
* LD_PRELOAD shim which applies two patches necesary to get the game
* Divinity: Original Sin Enhanded Edition for Linux to work with Mesa (12+)
*
* Build with: gcc -s -O2 -shared -fPIC -o divos-hack.{so,c} -ldl
*/
/* for RTLD_NEXT */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
/*
* Programa que gerencia contas de um usuario
* Autores: - Romano Augusto M. de Souza - 407111432
* - Nome - Matricula
* - Nome - Matricula
*/
/* Inclusoes de bibliotecas */
#include <stdio.h> // Uso de 'printf' e 'scanf'
#include <stdlib.h> // Uso de chamadas ao sistema operacional
@romanodesouza
romanodesouza / gist:06d4f4fc277ee82653a6
Created May 11, 2015 17:08
Enables Emacs key bindings on GTK 3
gsettings set org.gnome.desktop.interface gtk-key-theme "Emacs"
<?php
define('BASE_URL', 'http://chimera.labs.oreilly.com/books/1230000000545/');
function getPage($url)
{
$full_url = BASE_URL . $url;
echo "Crawleando página $full_url...", PHP_EOL;
$file = __DIR__ . '/ebook/'. $url;
file_put_contents($file, file_get_contents($full_url));
mkdir -p {{0..9},{a..f}}/{{0..9},{a..f}}/{{0..9},{a..f}}/{{0..9},{a..f}}
#!/bin/bash
#
# Pretty basic script for php psr0 refactoring
# USAGE:
# Don't touch the php file! Just use "git mv" and then run this script
FILES=""
function set_files_by_git_status() {
FILES=`git status -s | grep ^R | awk '{print $4}'`
@romanodesouza
romanodesouza / Vagrantfile
Created February 2, 2014 22:48
Vagrant + PHP + Phalcon + MySQL 5.6 + Nginx + memcached + apcu + xdebug
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "quantal64"
config.vm.network :forwarded_port, guest: 8080, host: 8080
config.vm.hostname = "vagrant-php"
config.vm.provision "shell", inline: <<SCRIPT
# Apt
sed -i 's,archive\.,br\.archive\.,' /etc/apt/sources.list
#!/bin/bash
for elm in $@; do
database=$(echo $elm | cut -f1 -d '.')
tables=$(echo $elm | cut -f2 -d '.')
if [ $tables == "{*}" ]; then
tables=$(mysql -uroot -e "SHOW TABLES FROM $database")
tables=$(echo $tables | sed s",^Tables_in_$database,,")
fi
<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- Setting a block that will NOT be overrided -->
{% block someBlock %}{% endblock %}
</head>
<body>
<!-- Using a component from Di -->
{{ myService.doAction() }}