Skip to content

Instantly share code, notes, and snippets.

@Shaptic
Shaptic / protocol-20-sdk.md
Last active September 19, 2023 18:22
Support for Protocol 20: Soroban

When closing this issue, please respond with at least the GitHub release that supports Protocol 20.

Protocol 20: Soroban

The next version of the Stellar network will feature a new smart contract platform called Soroban. Note that this version features only additive changes: existing operations, etc. have not changed. (Protocol 20 will be the same thing as "Preview 11," the latest release of Soroban to Stellar Futurenet.)

New XDR Schema

@Shaptic
Shaptic / cap33-sdk-issue.md
Last active April 19, 2021 18:11
Ensure that it's possible to create accounts with zero starting balance.

With the introduction of Protocol 14 and specifically CAP-33, accounts can now be created without a starting balance (given a sponsor).

The CAP notes:

Operation Validity Changes
Any downstream system relying on the fact that CreateAccountOp is invalid if startingBalance = 0 will be affected.

This subtlety is easy to overlook, so please ensure that the SDK allows this updated constraint.

If this SDK validates the starting balance to prevent starting balances of zero, please update the SDK to allow it.

@Shaptic
Shaptic / keybase.md
Created September 18, 2020 18:07
keybase proof

Keybase proof

I hereby claim:

  • I am shaptic on github.
  • I am george_k (https://keybase.io/george_k) on keybase.
  • I have a public key ASCDAZ3NJDKglo0EzOL8900A-bgMAcK-ul5-ABsBp2Jqkgo

To claim this, I am signing this object:

@Shaptic
Shaptic / Triangulate.cpp
Last active July 11, 2021 19:32
Fokin' triangulation in C++.
#include <cstdint>
#include <list>
#include <vector>
#include <algorithm>
// This code uses C++11 features like "auto" and initializer lists.
// Compare two floating point numbers accurately.
bool compf(float a, float b, float threshold=0.00001f)
{
@Shaptic
Shaptic / Triangulate.py
Last active June 14, 2023 23:31
Fokin' triangulation.
"""
Triangluation simulator.
Left mouse button: place a vertex.
Right mouse button: finalize a shape.
T: triangulate shapes.
"""
import math
from random import randint
@Shaptic
Shaptic / Settings.cpp
Created June 21, 2013 22:26
operator[] of the Settings module.
// In the CSettings.hpp class definition:
std::map<
#ifndef _DEBUG
uint32_t,
#else
string_t,
#endif // _DEBUG
COption> m_Options;
COption& CSettings::operator[](const string_t& opt)
@Shaptic
Shaptic / Option.cpp
Created June 21, 2013 21:44
Implementation of the header gist.
#include "Option.hpp"
COption::COption(){}
COption::COption(const string_t& value) :
m_value(value) {}
COption::COption(const COption& Opt) :
m_value(Opt.m_value) {}
@Shaptic
Shaptic / Option.hpp
Last active December 18, 2015 19:39
Generic option class that can act as any 'plain-old-data' type.
#include <string>
#include <ostream>
// This is in a different header, but we include it here
// for completeness-sake.
namespace math
{
static inline
bool compf(const float a, const float b,
const float threshold = 0.0001)
@Shaptic
Shaptic / QTreeTest.cpp
Last active December 18, 2015 05:49
Testing IronClad quad tree insertion of 1000000 objects and collision with one.
#include <sys/timeb.h>
#include "IronClad.hpp"
using namespace ic;
// For tracking time.
uint32_t now()
{
timeb t;
ftime(&t);
@Shaptic
Shaptic / LevelSplit.cpp
Last active December 15, 2015 12:28
Split an IronClad level into accessible tiles for AI path-finding.
#include "IronClad/Math/Math.hpp"
#include "IronClad/Entity/RigidBody.hpp"
using ic::math;
using ic::obj;
// Splits level into accessible 32x32 rectangles.
std::vector<rect_t> partition(const ic::CLevel& Level)
{
const std::vector<CRigidBody*>& allEntities =