This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Bool "mo:base/Bool"; | |
import Int "mo:base/Int"; | |
import Nat "mo:base/Nat"; | |
actor { | |
// ************************* | |
// *** CODING CHALLENGES *** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Int "mo:base/Int"; | |
actor { | |
// ************************* | |
// *** MIN MAX FUNCTIONS *** | |
// ************************* | |
public func get_min_value(x : Int, y : Int) : async Int { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actor { | |
var count : Int = 0; | |
public func increment() : async () { | |
count += 1; | |
}; | |
public query func get_value() : async Int { | |
count; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actor { | |
public func greeting( i : Text) : async Text { | |
"Hello, there " # i # "!!!"; | |
}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file tells vite config that we don't want code splitting | |
const defaultConfig = { | |
useRecommendedBuildConfig: true, | |
removeViteModuleLoader: false, | |
} | |
export function viteSingleFile({ | |
useRecommendedBuildConfig = true, | |
removeViteModuleLoader = false, | |
} = defaultConfig) { | |
return { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const scrollTo = (goTo, offset = 0, goToNumber = 0, time = 600) => { | |
var target = document.querySelectorAll(goTo)[goToNumber] | |
var targetPosition = target.offsetTop - offset | |
var startPosition = window.scrollY | |
var distance = targetPosition - startPosition | |
var duration = time | |
var startTime = null | |
function animationScroll(currentTime) { | |
if (startTime === null) startTime = currentTime |