Skip to content

Instantly share code, notes, and snippets.

View ernestognw's full-sized avatar
👨‍💻

Ernesto García ernestognw

👨‍💻
View GitHub Profile
@ernestognw
ernestognw / C.cpp
Last active September 14, 2019 21:14
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main(){
int n, m, c;
cin >> n >> m >> c;
// Cars[0] will be n position
// Cars[1] will be m position
clear
///////////////////////////////////////////////////////
// GaussJordan.sce
//
// Este programa calcula el resultado de
// un sistema de ecuaciones con el método
// de Gauss Jorden
//
// Ernesto Garcia -- A00820783
// Santiago Díaz -- A01252554
pragma solidity ^0.5.11;
contract Calculadora {
// Variables
uint256 public res;
uint256 limit; // Limit será el máximo entero que puede representar la calculadora
// Constructor
constructor() public {
res = 0;
pragma solidity 0.5.11;
contract Aseguradora {
// Variables
address public aseguradora;
address public gobierno;
uint256 public multiplicador;
struct Seguro {
uint cantidad;
pragma solidity 0.5.11;
contract BBVACoin {
// Variables
string public name;
string public symbol;
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
address public owner;
// boogle
// Ernesto García A00820783
// Created at Mon Nov 18 01:04:02 CST 2019
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int BFS(int i, int j, string word, int positionInWord, vector<vector<bool> > visited, vector <vector<char> > &grid){
@ernestognw
ernestognw / create-pair.js
Created January 11, 2020 20:20
Create and enable Stellar key pair for wallet
// utils/create-pair.js
const StellarSdk = require("stellar-sdk");
const fs = require("fs");
const path = require("path");
const fetch = require("node-fetch");
const pair = StellarSdk.Keypair.random();
const createTestAccount = async () => {
// Creamos nuestro par de llaves
@ernestognw
ernestognw / check-balance.js
Last active January 11, 2020 20:38
Stellar balance checker script
// utils/check-balance.js
const StellarSdk = require("stellar-sdk");
const dotenv = require("dotenv");
dotenv.config();
const server = new StellarSdk.Server("https://horizon-testnet.stellar.org");
const checkBalance = async () => {
// Cargamos la cuenta a través del sdk de Stellar
const account = await server.loadAccount(process.env.PUBLIC_KEY);
@ernestognw
ernestognw / check-recipient-balance.js
Last active March 31, 2020 20:24
Stellar destination address balance checker
// utils/check-recipient-balance.js
const StellarSdk = require("stellar-sdk");
const server = new StellarSdk.Server("https://horizon-testnet.stellar.org");
const checkRecipientBalance = async () => {
// Cargamos la cuenta a través del sdk de Stellar
const account = await server.loadAccount(
"GDC75JQ6SOC3EJU5FL2IO6JL5Y2HUEPZQBVAM2TESCLG5NMYPSX6JJRP"
);
@ernestognw
ernestognw / send-transaction.js
Last active March 31, 2020 20:42
Transaction creator for Stellar
// utils/send-transaction.js
const StellarSdk = require("stellar-sdk");
const server = new StellarSdk.Server("https://horizon-testnet.stellar.org");
const dotenv = require("dotenv");
dotenv.config();
const sourceKeys = StellarSdk.Keypair.fromSecret(process.env.SECRET);
const destination = "GDC75JQ6SOC3EJU5FL2IO6JL5Y2HUEPZQBVAM2TESCLG5NMYPSX6JJRP";