Skip to content

Instantly share code, notes, and snippets.

View marco-martins's full-sized avatar

Marco Martins marco-martins

View GitHub Profile
@marco-martins
marco-martins / metadata.json
Last active June 14, 2022 16:31
double-pay.js
{"valueParameterInfo":[["Deposit",{"valueParameterFormat":{"contents":[6,""],"tag":"DecimalFormat"},"valueParameterDescription":""}]],"timeParameterDescriptions":[],"roleDescriptions":[["Giver1",""]],"contractType":"Other","contractShortDescription":"","contractName":"Double Pay","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
@marco-martins
marco-martins / Main.hs
Created June 13, 2022 17:56 — forked from ajuggler/Main.hs
MPP - Bank Client agreement (homework)
{-# LANGUAGE OverloadedStrings #-}
module Example where
import Language.Marlowe.Extended
np = 3 :: Integer -- Number of payments (positive integer)
am = 50 :: Integer -- Amount (in Ada) of each deposit by Client (positive integer)
main :: IO ()
main = printJSON $ contract np am (TimeParam "Bank Deadline") (TimeParam "Client Deadline")
@marco-martins
marco-martins / metadata.json
Last active June 13, 2022 19:44 — forked from ayo-dan/metadata.json
MPP Homework Lecture 4
{"valueParameterInfo":[["Bank Deposit",{"valueParameterFormat":{"contents":[6,""],"tag":"DecimalFormat"},"valueParameterDescription":""}],["Client Deposit",{"valueParameterFormat":{"contents":[6,""],"tag":"DecimalFormat"},"valueParameterDescription":""}]],"timeParameterDescriptions":[["Bank Deposit Timeout",""],["Client Deposit Timeout 1",""]],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
@marco-martins
marco-martins / metadata.json
Last active June 9, 2022 18:42
MPP - Choice & If
{"valueParameterInfo":[["Amount",{"valueParameterFormat":{"contents":[6,"Ada"],"tag":"DecimalFormat"},"valueParameterDescription":"Amount"}]],"timeParameterDescriptions":[["despositDeadline","Deadline for the deposit"],["choiceDeadline","Deadline for the choice"]],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
@marco-martins
marco-martins / metadata.json
Last active June 7, 2022 14:54
Simple contract
{"valueParameterInfo":[],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Simple contract example","contractName":"Simple contract","contractLongDescription":"The giver pay to there account 100 Ada and the receiver get's all Ada from the giver account","choiceInfo":[]}
@marco-martins
marco-martins / tmux-cheatsheet.markdown
Created December 10, 2020 11:37 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
{
"Producers": [
{
"addr": "relay1.hype-staking.com",
"port": 3001,
"valency": 1
},
{
"addr": "relay2.hype-staking.com",
"port": 3002,
@marco-martins
marco-martins / removeKeys.js
Created October 25, 2019 09:17 — forked from aurbano/removeKeys.js
Remove a property from a nested object, recursively
/**
* Remove all specified keys from an object, no matter how deep they are.
* The removal is done in place, so run it on a copy if you don't want to modify the original object.
* This function has no limit so circular objects will probably crash the browser
*
* @param obj The object from where you want to remove the keys
* @param keys An array of property names (strings) to remove
*/
function removeKeys(obj, keys){
var index;
@marco-martins
marco-martins / generators.scss
Last active October 8, 2019 08:38 — forked from jeremyben/generators.scss
Size Generators (margin, padding, font-size) #scss #stylus
// Generate class helpers for size properties such as margin, padding, font-size
// Usage :
// @include marginer(5, 60, 5)
// .mt5 will then add margin-top:5px to the element,
// and so on for each side, from 5px to 60px with a 5px step.
@mixin marginer($min, $max, $step) {
.mt#{$min} {margin-top: $min*1px}
.mb#{$min} {margin-bottom: $min*1px}
.ml#{$min} {margin-left: $min*1px}
@marco-martins
marco-martins / bdd.it.sublime-snippet
Last active February 14, 2019 09:01
BDD it sublime text snippet
<snippet>
<content><![CDATA[it('should ${1}', ${2:async }() => {
${0:// body...}
});
]]></content>
<tabTrigger>it</tabTrigger>
<scope>source.js,source.ts</scope>
<description>BDD It</description>
</snippet>