Skip to content

Instantly share code, notes, and snippets.

View fabriceleal's full-sized avatar
😫
meh

Fabrice Ferreira Leal fabriceleal

😫
meh
  • Leiria, Portugal
View GitHub Profile
@fabriceleal
fabriceleal / test-swipl-devel-1093.cc
Last active January 13, 2023 19:45
testing swipl-devel/issues/1093
#include <SWI-Prolog.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
// https://github.com/SWI-Prolog/swipl-devel/issues/1093
int ac = 0;
char *av[10];
# http://fstar-lang.org/tutorial/book/under_the_hood/uth_smt.html#designing-a-library-with-smt-patterns
from z3 import *
Fuel = Datatype('Fuel')
Fuel.declare('ZFuel')
Fuel.declare('SFuel', ('pred', Fuel))
Fuel = Fuel.create()
ZFuel = Fuel.ZFuel
SFuel = Fuel.SFuel
@fabriceleal
fabriceleal / maint.sh
Created September 24, 2019 11:38
git maintenance
git gc --aggressive
git gc --prune=now
@fabriceleal
fabriceleal / autom.sh
Created October 21, 2018 19:58
compile with autoconf
autoreconf -i
autoconf
./configure
make
@fabriceleal
fabriceleal / gist:2e35d0b4b4f879930550
Created November 3, 2014 08:56
Call C pre processor without line markers in the output
gcc -E -P some.h > some.prep.h
@fabriceleal
fabriceleal / gist:8286782
Created January 6, 2014 18:04
Apache as proxy
# From:
# http://stackoverflow.com/questions/17475587/setup-mod-proxy-on-apache-http-server
# http://www.forums.serverwatch.com/showthread.php?16887-mod_proxy-problem
# http://serverfault.com/questions/242650/setting-up-a-basic-mod-proxy-virtual-host
# http://stackoverflow.com/questions/14775248/apache-http-proxy-based-on-hostname
# http://stackoverflow.com/questions/1997001/setting-up-a-basic-web-proxy-in-apache
# http://ubuntuforums.org/showthread.php?t=983222
#
# put on httpdvhosts.conf
@fabriceleal
fabriceleal / gist:7803969
Last active February 22, 2024 09:21
Decent enough macro for exporting csvs from Excel.
' http://support.microsoft.com/kb/291296/en-us
' http://superuser.com/questions/130592/how-do-you-force-excel-to-quote-all-columns-of-a-csv-file
' - change integer to long indexing
' http://stackoverflow.com/questions/2524703/save-text-file-utf-8-encoded-with-vba
' - output utf8 content
Sub QuoteCommaExport()
' Dimension all variables.
Dim DestFile As String
Dim FileNum As Integer
@fabriceleal
fabriceleal / gist:7417279
Created November 11, 2013 17:49
Search for sql inserts without explicit columns.
grep -Eir "insert +into +[a-zA-Z0-9_]+ values" *
@fabriceleal
fabriceleal / gist:6994504
Created October 15, 2013 16:34
Find big files
find . -type f -size +10000k -exec ls -lh {} \;
@fabriceleal
fabriceleal / gist:6609675
Last active December 23, 2015 08:39
Get query parameters
function getParams() {
var parameters = location.search.substring(1).split('&'); // drop initial '?' and get array of 'key=value'
var obj = {};
for(var i=0; i < parameters.length; ++i){
// 0 with the key, 1 with the value
var keyvalue = parameters[i].split('=');
// this won't work well when we try to pass jsons as parameters.
obj[ decodeURIComponent(keyvalue[0]) ] = decodeURIComponent(keyvalue[1]);