Skip to content

Instantly share code, notes, and snippets.

@isidroamv
isidroamv / DesignPatters: Strategy-Composition.ts
Created February 4, 2024 20:24
HeaFirstDesignPatters: Strategy - Composition
interface FlyBehavior {
fly(): void;
}
interface QuackBehavior {
quack(): void;
}
class FlyWithWings implements FlyBehavior {
fly(): void {
@isidroamv
isidroamv / VotingSystem.sol
Last active June 7, 2023 09:27
Simple collective decision-making system on Ethereum
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract VotingSystem {
/* Users should join a organization to create proposals
* The field sensitivity is the quorum required to approve the proposal
*/
(function(u,p,l,i,f,t,o,b,j){u['UpLiftPlatformObject']=f;u[f]=u[f]||function(){
(u[f].q=u[f].q||[]).push(arguments)},u[f].l=1*new Date();b=p.createElement(l),
j=p.getElementsByTagName(l)[0];b.async=1;b.src=i+'?id='+t;
j.parentNode.insertBefore(b,j);o=u.location.host.match(/[\w-]+\.\w{2,3}(:\d+)?$/);
if(o)o=o[0];u[f]('create',t,o)})(window,document,'script','https://cdn.uplift-platform.com/a/up.js',
'up','UP-79113567-16');
(function(u,p,l,i,f,t,o,b,j){u['UpLiftPlatformObject']=f;u[f]=u[f]||function(){
(u[f].q=u[f].q||[]).push(arguments)},u[f].l=1*new Date();b=p.createElement(l),
j=p.getElementsByTagName(l)[0];b.async=1;b.src=i+'?id='+t;
j.parentNode.insertBefore(b,j);o=u.location.host.match(/[\w-]+\.\w{2,3}(:\d+)?$/);
if(o)o=o[0];u[f]('create',t,o)})(window,document,'script','https://cdn.uplift-platform.com/a/up.js',
'up','UP-97221441-1');
@isidroamv
isidroamv / Blue Diamond Resorts
Created February 2, 2023 20:12
Blue Diamond Resorts
(function(u,p,l,i,f,t,o,b,j){u['UpLiftPlatformObject']=f;u[f]=u[f]||function(){
(u[f].q=u[f].q||[]).push(arguments)},u[f].l=1*new Date();b=p.createElement(l),
j=p.getElementsByTagName(l)[0];b.async=1;b.src=i+'?id='+t;
j.parentNode.insertBefore(b,j);o=u.location.host.match(/[\w-]+\.\w{2,3}(:\d+)?$/);
if(o)o=o[0];u[f]('create',t,o)})(window,document,'script','https://cdn.uplift-platform.com/a/up.js',
'up','UP-73285543-1');
(function(u,p,l,i,f,t,o,b,j){u['UpLiftPlatformObject']=f;u[f]=u[f]||function(){
(u[f].q=u[f].q||[]).push(arguments)},u[f].l=1*new Date();b=p.createElement(l),
j=p.getElementsByTagName(l)[0];b.async=1;b.src=i+'?id='+t;
j.parentNode.insertBefore(b,j);o=u.location.host.match(/[\w-]+\.\w{2,3}(:\d+)?$/);
if(o)o=o[0];u[f]('create',t,o)})(window,document,'script','https://cdn.uplift-platform.com/a/up.js',
'up','UP-79113567-13');
(function(u,p,l,i,f,t,o,b,j){u['UpLiftPlatformObject']=f;u[f]=u[f]||function(){
(u[f].q=u[f].q||[]).push(arguments)},u[f].l=1*new Date();b=p.createElement(l),
j=p.getElementsByTagName(l)[0];b.async=1;b.src=i+'?id='+t;
j.parentNode.insertBefore(b,j);o=u.location.host.match(/[\w-]+\.\w{2,3}(:\d+)?$/);
if(o)o=o[0];u[f]('create',t,o)})(window,document,'script','https://cdn.uplift-platform.com/a/up.js',
'up','UP-81257396-1');
(function(u,p,l,i,f,t,b,j){u['UpLiftPlatformObject']=f;u[f]=u[f]||function() {(u[f].q=u[f].q||[]).push(arguments)},u[f].l=1*new Date();b=p.createElement(l),j=p.getElementsByTagName(l)[0];b.async=1;b.src=i+'?id='+t;j.parentNode.insertBefore(b,j);var o=window.location.host.match(/[w-]+.w{2,3}(:d+)?$/);if(o)o=o[0];u[f]('create',t,o)})(window,document,'script','https://cdn.uplift-platform.com/a/up.js','up','UP-57912505-1')
(function(u,p,l,i,f,t,b,j){u['UpLiftPlatformObject']=f;u[f]=u[f]||function() {(u[f].q=u[f].q||[]).push(arguments)},u[f].l=1*new Date();b=p.createElement(l),j=p.getElementsByTagName(l)[0];b.async=1;b.src=i+'?id='+t;j.parentNode.insertBefore(b,j);var o=window.location.host.match(/[w-]+.w{2,3}(:d+)?$/);if(o)o=o[0];u[f]('create',t,o)})(window,document,'script','https://cdn.uplift-platform.com/a/up.js','up','UP-79113567-10')
(function(u,p,l,i,f,t,b,j){u['UpLiftPlatformObject']=f;u[f]=u[f]||function() {(u[f].q=u[f].q||[]).push(arguments)},u[f].l=1*new Date();b=p.createElement(l),j=p.getElementsByTagName(l)[0];b.async=1;b.src=i+'?id='+t;j.parentNode.insertBefore(b,j);var o=window.location.host.match(/[w-]+.w{2,3}(:d+)?$/);if(o)o=o[0];u[f]('create',t,o)})(window,document,'script','https://cdn.uplift-platform.com/a/up.js','up','UP-12766233-1')