Skip to content

Instantly share code, notes, and snippets.

View burakcanekici's full-sized avatar

Burakcan Ekici burakcanekici

View GitHub Profile
pragma solidity ^0.6.6;
contract BankContract {
struct client_account{
int client_id;
address client_address;
uint client_balance_in_ether;
}
<!doctype html>
<html lang="en">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#get").click(function(){
$.get("http://localhost/services/pokemon", function(data, status){
console.log(data);
$("#list").empty();
version: '3.8'
services:
frontend:
container_name: frontend
image: nginx-frontend
build:
context: ./frontend
ports:
- "80:80"
[ApiController]
[Produces("application/json")]
[Route("api/[controller]/[action]")]
public class MyController : Controller {
...
private readonly MyBackgroundService _myBackgroundService;
public MyController(HostedService hostedService)
{
public IServiceProvider ConfigureServices(IServiceCollection services)
{
...
services.AddSingleton<ReadFromURLProvider>();
services.AddSingleton<HostedService, MyBackgroundService>();
...
}
public class ReadFromURLProvider
{
private const string fileURL =
"https://gist.githubusercontent.com/armgilles/194bcff35001e7eb53a2a8b441e8b2c6/raw/92200bc0a673d5ce2110aaad4544ed6c4010f687/pokemon.csv";
private readonly HttpClient _httpClient;
public GetURLAndUpdateProvider()
{
_httpClient = new HttpClient();
public class MyBackgroundService : HostedService
{
private readonly ReadFromURLProvider _readFromURLProvider;
public MyBackgroundService(IServiceProvider serviceProvider, ReadFromURLProvider readFromURLprovider) : base(serviceProvider)
{
_readFromURLProvider = readFromURLProvider;
}
public async override Task ExecuteAsync(CancellationToken cancellationToken)
{
public abstract class HostedService : IHostedService
{
private Task _executingTask;
private CancellationTokenSource _cts;
private object serviceProvider;
protected HostedService(object serviceProvider)
{
this.serviceProvider = serviceProvider;
}
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
// Setting for Hyperledger Fabric
const { Wallets, FileSystemWallet, Gateway } = require('fabric-network');
const path = require('path');
const fs = require('fs');
{
"name": "burakcan-network-be1",
"version": "1.0.0",
"client": {
"organization": "Burakcan1",
"connection": {
"timeout": {
"peer": {
"endorser": "300"
}