Skip to content

Instantly share code, notes, and snippets.

View 0GiS0's full-sized avatar
📹
Now on YouTube!

Gisela Torres 0GiS0

📹
Now on YouTube!
View GitHub Profile
pragma solidity ^0.5.8;
contract TimeControl{
address private owner;
mapping (address => uint[]) private employeeRecords;
constructor() public{
owner = msg.sender;
}
function Register() public{
employeeRecords[msg.sender].push(now);
}
async (error, transactionHash) => {
if (error) {
console.log(`error: ${error}`);
}
else {
console.log(`transaction hash: ${transactionHash}`);
let receipt = await web3.eth.getTransactionReceipt(transactionHash);
console.log('Contract address: ' + receipt.contractAddress);
let contractDeployed = new web3.eth.Contract(abi, receipt.contractAddress);
contractDeployed.methods.Register.send({ from: creatorAccount }, (err, data) => {
const Web3 = require('web3');
let web3 = new Web3(new Web3.providers.HttpProvider("HTTP://127.0.0.1:7545"));
web3.eth.getAccounts().then(accounts => {
//Get the account which create the contract
let creatorAccount = accounts[0];
//Deploy contract
const contract = new web3.eth.Contract(abi);
contract.deploy({
data: '0x' + bytecode
const path = require('path');
const fs = require('fs');
const solc = require('solc');
const contractPath = path.resolve(__dirname, "..", 'TimeControl.sol');
const source = fs.readFileSync(contractPath, 'utf8');
let jsonContractSource = JSON.stringify({
language: 'Solidity',
sources: {
'TimeControl': {
pragma solidity ^0.5.8;
contract TimeControl{
address private owner;
mapping (address => uint[]) private employeeRecords;
constructor() public{
owner = msg.sender;
}
function Register() public{
employeeRecords[msg.sender].push(now);
}
function calculateFibonacci(number) {
if (number == 0 || number == 1)
return number;
return (calculateFibonacci(number - 1) + calculateFibonacci(number - 2));
}
function doStuff(serie) {
return new Promise((resolve, reject) => {
if (typeof serie === 'number') {
var results = [];
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
<style>
#home {
background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url(https://live.staticflickr.com/4544/27053562599_40e1815d95_k.jpg);
}
#about {
background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url(@Configuration["AppConfigurationDemo:Index:AboutImage"]);
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
@addTagHelper *, Microsoft.FeatureManagement.AspNetCore
<style>
#welcome {
background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url(https://live.staticflickr.com/1937/30715340707_d0696024c8_k.jpg);
}
#home {
@0GiS0
0GiS0 / Program.cs
Last active February 3, 2019 19:55
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.WindowsAzure.Storage.Core.Util;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace AzureBlobAsyncProgress
{
var tvShow = {
title: 'El Embarcadero',
seasons: 2,
watched: true
};
function watching({ title, seasons }) {
console.log(`I am watching ${title}. ${seasons} seasons of entertainment!`);
}