Skip to content

Instantly share code, notes, and snippets.

View yosevu's full-sized avatar

Yosevu Kilonzo yosevu

View GitHub Profile
@yosevu
yosevu / metadata.json
Created June 4, 2022 07:02
Marlowe in depth 2
{"valueParameterInfo":[["Amount",{"valueParameterFormat":{"contents":[6,"ada"],"tag":"DecimalFormat"},"valueParameterDescription":""}]],"slotParameterDescriptions":[["DepositDeadline","Deadline for the deposit"],["ChoiceDeadline","Deadline for the choice"]],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Giver makes a payment to receiver","contractName":"MPP - Simple payment (Close)","contractLongDescription":"Giver makes a payment to receiver","choiceInfo":[]}
@yosevu
yosevu / metadata.json
Created June 4, 2022 01:10
Marlowe in depth
{"valueParameterInfo":[],"slotParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"","contractName":"","contractLongDescription":"","choiceInfo":[]}
@yosevu
yosevu / machine.js
Created April 12, 2021 11:02
Generated by XState Viz: https://xstate.js.org/viz
const lightBulbMachine = Machine({
id: 'lightBulb',
initial: 'unlit',
states: {
lit: {
on: {
BREAK: 'broken',
TOGGLE: 'unlit',
},
},
@yosevu
yosevu / disney-quotes.txt
Created March 31, 2021 17:36
Disney Quotes
“The flower that blooms in adversity is the most rare and beautiful of all” – Mulan
“All it takes is faith and trust”– Peter Pan
“The past can hurt. But the way I see it, you can either run from it or learn from it” – The Lion King
“Today is a good day to try” – The Hunchback of Notre Dame
“Just because it’s what’s done, doesn’t mean it’s what should be done” – Cinderella
“Some people are worth melting for” – Frozen
“The only way to get what you want in this world is through hard work” – The Princess and the Frog
“Can anybody be happy if they aren’t free?” – Beauty and the Beast
“The only thing predictable about life is its unpredictability” – Ratatouille
“Remember who you are” – The Lion King
@yosevu
yosevu / getNumberOfStars.js
Last active January 28, 2020 04:01
getNumberOfStars
// Fixtures
const FILLED_STAR = '<filled/>';
const EMPTY_STAR = '<empty/>';
const MAX_STARS = 5;
const numberOfStars = 3;
// Version 1
R.join('',
R.concat(
@yosevu
yosevu / lint-heat-map.txt
Created August 5, 2019 12:29
lint heat map
30:3 error Unexpected let, use const instead functional/no-let
30:7 error 'calendarData' is never reassigned. Use 'const' instead prefer-const
31:3 error Unexpected let, use const instead functional/no-let
33:3 error Unexpected loop, use map or reduce instead functional/no-loop-statement
34:5 error Using expressions to cause side-effects not allowed functional/no-expression-statement
34:5 error Modifying an existing object/array is not allowed functional/immutable-data
35:5 error Using expressions to cause side-effects not allowed functional/no-expression-statement
38:3 error Unexpected loop, use map or reduce instead functional/no-loop-statement
38:8 error Unexpected let, use const instead functional/no-let
39
@yosevu
yosevu / git-checkout-escape-wildcard.txt
Created July 2, 2019 11:52
git checkout escape wildcard
git checkout -- 'packages/**/package-lock.json'
@yosevu
yosevu / transformStyle.js
Created June 14, 2019 15:33
Transform Style
const getSelectedOptions = facet => {
const options = get(
facet,
'searchFacetOptionGroupList.searchFacetOptionList'
);
const isActiveAndSelected = option =>
option.isActive === 'true' && option.isSelected === 'true';
return filter(options, isActiveAndSelected);
};
@yosevu
yosevu / transform-style.js
Last active June 13, 2019 12:53
transformStyle
// transformStyle :: Object -> Object
const transformStyle = facet => {
result.facetSelected.style = [];
facetOptions.style = facet;
facetOptions.style.searchFacetName = 'Category';
facetOptions.style.facetType = 'multi-select';
facetOptions.style.facetLayout = 'list';
@yosevu
yosevu / checkbox.scss
Last active June 12, 2019 20:09
left-facet checkbox styles #gap
.checkbox {
@extend .sds_checkbox-a;
&__input {
@extend .sds_checkbox-a__input;
}
&__box {
@extend .sds_checkbox-a__box;
}