Skip to content

Instantly share code, notes, and snippets.

View jessicacarneiro's full-sized avatar

Jéssica Carneiro jessicacarneiro

View GitHub Profile
SELECT "Who checked out the book 'The Hobbit’?";
SELECT DISTINCT member.name FROM member WHERE member.id
IN (SELECT checkout_item.member_id
FROM checkout_item WHERE checkout_item.book_id
IN (SELECT id FROM book WHERE title = "The Hobbit")
);
SELECT "How many people have not checked out anything?";
SELECT COUNT(DISTINCT member.id)
FROM member, checkout_item

Keybase proof

I hereby claim:

  • I am jessicacarneiro on github.
  • I am jessicacarneiro (https://keybase.io/jessicacarneiro) on keybase.
  • I have a public key ASCYus3nL6pXPhhOYSBCZ8dTg_bz4Phce8T-1C5rB8poDQo

To claim this, I am signing this object:

@jessicacarneiro
jessicacarneiro / remove.sh
Created March 22, 2019 20:00
Script to remove files from a list (.txt). I got this script from https://stackoverflow.com/a/5142498
for f in $(cat to_delete.txt) ; do
rm "$f"
done
uint32_t freeRam() // for Teensy 3.0
{
uint32_t stackTop;
uint32_t heapTop;
// current position of the stack.
stackTop = (uint32_t) &stackTop;
// current position of heap.
void* hTop = malloc(1);
@jessicacarneiro
jessicacarneiro / ecdsa.ino
Created November 23, 2017 14:02
Example of use of RELIC's ECDSA.
#include <string.h>
#define SIZE_MSG 5
extern "C" {
#include "../include/relic.h"
}
int relic_setup()
{
@jessicacarneiro
jessicacarneiro / ecies.ino
Created November 23, 2017 13:49
Example of use of RELIC's ECIES in an Arduino
#include <string.h>
extern "C" {
#include "../include/relic.h"
}
int relic_setup(){
if (core_init() != STS_OK) {
core_clean();
return 1;
@jessicacarneiro
jessicacarneiro / aes_cbc_128.ino
Last active March 2, 2018 22:40
Example of use of RELIC's AES CBC mode on Arduino
extern "C" {
#include "../include/relic.h"
}
#define KEYSZ 16
#define CIPHER_TEXT_SZ(PLAINTEXT_SZ) (PLAINTEXT_SZ + BLOCK_SZ - (PLAINTEXT_SZ % BLOCK_SZ))
#include <string.h>
void setup()
@jessicacarneiro
jessicacarneiro / aes_cbc_128.c
Created November 1, 2017 15:44
Example of use of RELIC's AES function
#include <stdio.h>
#include "relic.h"
#define KEYSZ 128
int main()
{
if (core_init() != STS_OK) {
core_clean();
return EXIT_FAILURE;
@jessicacarneiro
jessicacarneiro / .bash_aliases
Last active February 21, 2019 13:01
My bash aliases for Ubuntu working with Arduino stuff
# open file
alias open='xdg-open'
# reload .bashrc
alias rl='source ~/.bashrc'
# install stuff
alias install='sudo dpkg -i'
# Alias to use todo.sh
@jessicacarneiro
jessicacarneiro / hmac.ino
Last active October 12, 2017 16:05
How to use HMAC with RELIC on Arduino
extern "C" {
#include "../include/relic.h"
}
void setup() {
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect
}