Skip to content

Instantly share code, notes, and snippets.

@edolganov
edolganov / contracts...test_hello.sol
Created June 5, 2022 19:56
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7;
contract Hello {
function hello(string memory name) public pure returns (string memory) {
return string(bytes.concat("hello, ", bytes(name), "!"));
}
}
@edolganov
edolganov / main_out.js
Created May 10, 2015 17:19
agar.io game client with bots
//replace http://agar.io/main_out.js by this file
//with Fiddler Web Debugger (AutoResponder tab)
//bots can be created in different rooms - so try restart the page if need
var totalBotCount = 0;
function game(h, r, bot, botUrl, botName) {
@edolganov
edolganov / 00_info
Last active August 29, 2015 14:07
Simple java web-sockets demo
This is java websockets exapmle:
Files:
- 01_GameServer.java - start server with Jetty Server inside
- 02_GameSocketServlet.java - mapping to ws://127.0.0.1:8210/gamestate url
- 03_GameSocket.java - handler of websocket connections
- 04_SocketPlayer.java - link between the server and the specific client
- 05_GameApp.java - the game engine
- 06_GameMap.java - map model
- 07_GameSession.java - game session with connected players
- 08_PlayerGameState.java - player's state in a session
<%@ taglib tagdir="/WEB-INF/tags/util" prefix="util" %>
<%-- tag should be placed to Web-inf/tags/util/toJson.tag --%>
<script id="scheduleData" type="json-data"><util:toJson source="${schedule}"/></script>