Skip to content

Instantly share code, notes, and snippets.

View fede-rodes's full-sized avatar

Federico Rodes fede-rodes

View GitHub Profile
@fede-rodes
fede-rodes / sponsor.js
Created January 19, 2025 03:24 — forked from laalaguer/sponsor.js
sponsor using Express framework
const express = require('express')
const cry = require('thor-devkit/dist/cry')
const Transaction = require('thor-devkit/dist/transaction').Transaction
const app = express()
app.use(express.json())
const port = 3000
app.post('/', function(req, res) {
@fede-rodes
fede-rodes / user.js
Created January 19, 2025 03:24 — forked from laalaguer/user.js
User's side Snippet
/**
* Attempt to commit a transaction to a contract.
*
* With a hefty wallet as "sponsor" + an empty wallet as "sender".
*
*/
const fetch = require("node-fetch");
const cry = require('thor-devkit/dist/cry')
const Transaction = require('thor-devkit/dist/transaction').Transaction
// TOP LEVEL IMPORTS
import React from 'react';
import PropTypes from 'prop-types';
// ANTD
import Input from 'antd/lib/input';
import 'antd/lib/input/style/css';
import Icon from 'antd/lib/icon';
import 'antd/lib/icon/style/css';
// EXPORTED COMPONENT
const cheerio = require('cheerio');
const request = require('request');
request('https://www.cuantocabron.com/ultimos/p/1', (error, response, body) => {
// console.log('error:', error); // Print the error if one occurred
// console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
// console.log('body:', body); // Print the HTML for the Google homepage.
const $ = cheerio.load(body)
//--------------------------------------------------------------------
// COMPONENT DEFINITION:
//--------------------------------------------------------------------
// See renderProps: https://www.youtube.com/watch?v=BcVAq3YFiuc
import React from 'react';
import PropTypes from 'prop-types';
import { Query } from 'react-apollo';
import Text from '../Components/Text';
import CenteredActivityIndicator from '../Components/CenteredActivityIndicator';
class CreateGameScreen extends React.Component {
this.state = {
curView: 'sportAndTime',
sport: '',
date: null,
time: null,
spotId: '',
description: '',
}