Skip to content

Instantly share code, notes, and snippets.

🎮
making

Érico Vieira Porto ericoporto

🎮
making
Block or report user

Report or block ericoporto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MinStack.cpp
struct stackObj {
int num_;
int min_; // We track min in the stackObject.
stackObj* nextItem_;
stackObj(int num, stackObj* nextItem = nullptr) : num_(num), min_(num), nextItem_(nextItem) {};
}; // The min of a stackObj is initially itself. Later it is compared to the item below it.
class MinStack {
private:
int size_;
View namegen.asc
// Fantasy name generator AGS Module Script
#region CREATE_WORD_TABLES
//---- CREATE WORD TABLES -----------------------------
String _symbol_s[];
String _symbol_v[];
String _symbol_big_v[];
String _symbol_c[];
String _symbol_big_b[];
@ericoporto
ericoporto / simpleLicense.sol
Created Nov 1, 2019
exercise: Simple contract to store software licenses in solidity
View simpleLicense.sol
pragma solidity ^0.5.11;
contract SoftwareLicense {
struct License {
uint serial;
address user;
uint datetime;
}
@ericoporto
ericoporto / fund.sol
Last active Nov 1, 2019
A game like Ethereum fund in Solidity
View fund.sol
pragma solidity ^0.5.11;
contract Fund {
address payable manager = msg.sender;
uint reserve = 0;
uint redemptionFee = 100;
struct Account{
uint balance;
bool isValid;
@ericoporto
ericoporto / CMakeLists.txt
Last active Nov 3, 2019
Changes to build ags Compiler under Linux. CMakeLists.txt should go under Solutions/Compiler.Lib
View CMakeLists.txt
# File generated at : 17:30:59, Wed 30 Oct
# Converted Project : Compiler.Lib.vcxproj
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
##################### Variables ############################
# Change if you want modify path or other values #
############################################################
# Project
get_filename_component(PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
@ericoporto
ericoporto / CoolAnimate.asc
Created Sep 26, 2019
CoolAnimate for Adventure Game Studio, Animate from any frame
View CoolAnimate.asc
// new module script
managed struct CoolAnimateData{
bool animating;
int delay;
int count;
};
CoolAnimateData* coolData[];
void game_start(){
@ericoporto
ericoporto / character_followinfo.diff
Created Sep 26, 2019
changes from 1byte to short
View character_followinfo.diff
diff --git a/Common/ac/characterinfo.cpp b/Common/ac/characterinfo.cpp
index dbcbcf39..2cfb1561 100644
--- a/Common/ac/characterinfo.cpp
+++ b/Common/ac/characterinfo.cpp
@@ -31,7 +31,7 @@ void CharacterInfo::ReadFromFile(Stream *in)
wait = in->ReadInt32();
flags = in->ReadInt32();
following = in->ReadInt16();
- followinfo = in->ReadInt16();
+ followinfo = in->ReadInt32();
@ericoporto
ericoporto / PeriodClause.sol
Created Sep 6, 2019
Simple Solidity exercises
View PeriodClause.sol
pragma solidity ^0.5.11;
contract DurationClause {
uint CalendarDaysDuration; // a number of days period, in calendar days.
address Owner;
bool Active;
uint DurationLimit;
constructor(uint initialDuration, uint initialDurationLimit) public {
CalendarDaysDuration = initialDuration;
@ericoporto
ericoporto / escrow.sol
Created Sep 6, 2019
My first smart contract, done following a tutorial
View escrow.sol
pragma solidity ^0.5.0;
// MIT License
//
// Copyright (c) 2019 Érico Vieira Porto
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@ericoporto
ericoporto / note.md
Last active Sep 6, 2019
About Allegro, Visual Studio and Windows
View note.md

If debugging with Visual Studio and attaching to a process your PC slows to a crawl, try this:

Super+R regedit go to HKEY_CURRENT_USER\Control Panel\Desktop and find LowLevelHooksTimeout parameter (or create one, it's a REG_DWORD) usually it's set to like 5000 ms, so change to 10.

Unfortunately this doesn't seem to work with Windows 10.

You can’t perform that action at this time.