Skip to content

Instantly share code, notes, and snippets.

View gabrielbiga's full-sized avatar
🎯
Focusing

Gabriel Matos gabrielbiga

🎯
Focusing
View GitHub Profile
@gabrielbiga
gabrielbiga / firebase-build-gradle.js
Created March 28, 2022 18:01
Fix Firebase issue on {NS} 8.2
var path = require("path");
var fs = require("fs");
module.exports = function($logger, $projectData) {
let buildGradleContent;
function patchNode(node, check, content = check)
{
const originalDepNode = buildGradleContent.match(
new RegExp(node + " {[\\s\\S]*?}", "gi")
@gabrielbiga
gabrielbiga / org.wiboo.wibxp.financial.js
Created February 11, 2019 02:14
The org.wiboo.wibxp.financial file - Reusing functions in Hyperledger Composer chaincode
/** 
* Function to process the transfer transaction. 
* @param {org.wiboo.wibxp.financial.TransferTransaction} tx The financial transaction 
* @transaction 
*/ 
function transferTransaction(tx) 
{
  // Check if the amount is valid 
  isAmountValid(tx.amount); 
@gabrielbiga
gabrielbiga / global.js
Created February 11, 2019 02:11
The global file - Reusing functions in Hyperledger Composer chaincode
/**
* Check if the given amount is valid. 
* @param {number} amount The amount 
*/ 
function is AmountValid(amount) 
{
assert(amount >= 0, 'Invalid amount! Should be >= 0'); 
}
@gabrielbiga
gabrielbiga / gist:52e27a8b769792fac434
Created May 28, 2015 23:43
Stack sort based void structures
#include <stdio.h>
#include <stdlib.h>
typedef enum DATATYPE {
CUSTOMER,
CAR
} datatype_t;
struct customer
#include <stdio.h> //FUCKING I/O
#include <stdlib.h>
/* D:/matriz.txt ~>
* 6
* 101011
* 111100
* 101000
* 100111
* 011011
@gabrielbiga
gabrielbiga / gabarito.c
Created July 17, 2014 02:37
Corrigindo Múltipla Escolha
#include <stdio.h>
#include <stdlib.h>
//Offset de Q
#define Q 100
int main() {
int i, j; //laços
int quantidadeAlternativas; //Quantidade total de alternativas corretas
int quantidadeAlunos;
@gabrielbiga
gabrielbiga / gist:8f67b09432ff54aa44a6
Created June 11, 2014 18:07
Passing a pointer of a 2D array to function
#include <stdio.h>
#define LIN 2
#define COL 2
void mostraMatriz(int (*matriz)[LIN][COL]) {
printf("%d\n", (*matriz)[0][1]); //retorna 2
}
int main() {
@gabrielbiga
gabrielbiga / gist:9369282
Last active August 29, 2015 13:57
Circulo
/**
* Circulo
* com.gsoft.Circulo
*
* Operacoes com circulo
*
* 05/03/2014 @ 12:15:20 PM
* Copyright (C) 2014 Gsoft do Brasil Sistemas
*
* @author Gabriel Marinho <gabriel@gsoft.com.br>