Skip to content

Instantly share code, notes, and snippets.

View ericoporto's full-sized avatar
🎮
making

Érico Porto ericoporto

🎮
making
View GitHub Profile
@ericoporto
ericoporto / CMakeLists.txt
Last active November 3, 2019 12:17
Changes to build ags Compiler under Linux. CMakeLists.txt should go under Solutions/Compiler.Lib
# 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 September 26, 2019 02:18
CoolAnimate for Adventure Game Studio, Animate from any frame
// new module script
managed struct CoolAnimateData{
bool animating;
int delay;
int count;
};
CoolAnimateData* coolData[];
void game_start(){
@ericoporto
ericoporto / character_followinfo.diff
Created September 26, 2019 01:07
changes from 1byte to short
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 September 6, 2019 14:06
Simple Solidity exercises
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 September 6, 2019 12:12
My first smart contract, done following a tutorial
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 September 6, 2019 12:53
About Allegro, Visual Studio and Windows

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.

@ericoporto
ericoporto / snapcraft.yaml
Created August 2, 2019 02:34
Drawing test snapcraft.yaml
name: eri0o-drawing
base: core18
version: '0.4.2'
summary: Basic drawing app
description: |
This application is a basic image editor, similar to Microsoft Paint,
but aiming at the GNOME desktop. PNG, JPEG and BMP files are supported.
license: GPL-3.0
grade: devel # must be 'stable' to release
confinement: devmode # use 'strict'
@ericoporto
ericoporto / LinearInterpolation.bas
Last active December 8, 2025 05:53
Excel VBA Basic code for Linear Interpolation
Rem Linear Interpolation from a x and y ordered data, for a value
Rem TODO: make it work with unordered Data.
Function LinInterpolation(DataX As Range, DataY As Range, point As Range) As Variant
If point.Cells.Count > 1 Then
LinInterpolation = "Can only interpolate one value"
Exit Function
End If
Dim value As Double
value = point.value
@ericoporto
ericoporto / makeerror.txt
Created June 23, 2019 16:51
building ads osx error
$ make
cd /Users/ericoporto/git/ags/OSX/buildlibs/../../libsrc && ./download.sh
allegro-4.4.2.tar.gz: OK
dumb-0.9.3.tar.gz: OK
libogg-1.3.2.tar.gz: OK
libtheora-20150828-gfbb2758.tar.bz2: OK
libtheora-20160525-g50df933.tar.bz2: OK
libtremor-20150108-r19427.tar.bz2: OK
libvorbis-1.3.5.tar.gz: OK
lua-5.1.5.tar.gz: OK
@ericoporto
ericoporto / TwoColumnLayout.java
Created June 6, 2019 16:02
Two Column Java layout
//This example extends one in Horstmann,
//"Object Oriented Design and Patterns",
//John Wiley and Sons, 2003 (pages 192-193)
//
//It manages two columns: the left contains
// labels and the right contains text fields.
//The labels are right justified; the textfiles
// are left justified.
//There is a specifiable gap between the columns
// and the rows.