Skip to content

Instantly share code, notes, and snippets.

View ggiraldez's full-sized avatar

Gustavo Giráldez ggiraldez

View GitHub Profile
@ggiraldez
ggiraldez / main.nr
Created January 17, 2024 17:05
Newly supported Noir printable types
use dep::std;
struct Foo {
x: u32,
y: u32,
}
// use unconstrained to force Brillig output; some examples don't work with ACIR output
unconstrained fn main() {
// these are separators and act as sentinels to check that inputs are consumed correctly
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGOICOMgTXGyNM2l7OlFQxgawLKLMMZ6wcizgo01VZ8z ggiraldez@morpheus
@ggiraldez
ggiraldez / setcolors.vim
Created September 8, 2015 16:18
Vim colorscheme rotation
" Put this in .vim/plugin/
" Change the color scheme from a list of color scheme names.
" Slightly modified from http://vim.wikia.com/wiki/VimTip341
" Press key:
" F8 next scheme
" Shift-F8 previous scheme
" Alt-F8 random scheme
" Set the list of color schemes used by the above (default is 'all'):
" :SetColors all (all $VIMRUNTIME/colors/*.vim)

Keybase proof

I hereby claim:

  • I am ggiraldez on github.
  • I am ggiraldez (https://keybase.io/ggiraldez) on keybase.
  • I have a public key whose fingerprint is 2F9F 94AF 7E74 D5B7 AA4A 7FD8 B653 BAC1 39A0 C5DB

To claim this, I am signing this object:

@ggiraldez
ggiraldez / test.groovy
Created April 3, 2014 21:53
SQLite JDBC autoCommit race condition
Class.forName('org.sqlite.JDBC')
import groovy.sql.Sql
import java.sql.*
def sql = Sql.newInstance('jdbc:sqlite::memory:', [:] as Properties, 'org.sqlite.JDBC')
sql.execute('drop table if exists test')
sql.execute('create table test (key integer primary key, value string)')
def connection = sql.connection
@ggiraldez
ggiraldez / test.groovy
Last active August 29, 2015 13:58
SQLite JDBC getGeneratedKeys() race condition
Class.forName('org.sqlite.JDBC')
import groovy.sql.Sql
import java.sql.*
def sql = Sql.newInstance('jdbc:sqlite::memory:', [:] as Properties, 'org.sqlite.JDBC')
sql.execute('drop table if exists test')
sql.execute('create table test (key integer primary key, value string)')
def connection = sql.connection
@ggiraldez
ggiraldez / config-qdisc.sh
Last active August 29, 2015 13:57
Configure a Linux network interface to emulate low-bandwidth WAN connection
#!/bin/sh
# clear the previous discipline
tc qdisc del dev eth1 root
# latency 200ms with 20ms variation
# optional: loss 0.1%
tc qdisc add dev eth1 root handle 1:0 netem delay 200ms 20ms
# 256kbit bandwidth
@ggiraldez
ggiraldez / openssl_aes.c
Last active December 27, 2015 09:29
Compiling OpenSSL with MinGW from Cygwin
/**
AES encryption/decryption demo program using OpenSSL EVP apis
gcc -Wall openssl_aes.c -lcrypto
this is public domain code.
Saju Pillai (saju.pillai@gmail.com)
**/
#include <string.h>
@ggiraldez
ggiraldez / gist:7141132
Last active December 26, 2015 10:59
Adding encryption to sqlite JDBC driver with Botan
# Install Botan dependency
$ brew install botan
# Check out botansqlite3
$ git clone git@github.com:OlivierJG/botansqlite3.git
# Copy all files from botansqlite3 to sqlite-jdbc/target/sqlite-amalgamation-3071500
$ echo '#include "codecext.c"' >> sqlite3.c
# Compile native library and JAR