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 'package:flutter/material.dart'; | |
void main() => runApp(const MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
GITMODULES=".gitmodules" | |
FEXT=".bak" | |
GITMODULES_BACKUP="${GITMODULES}${FEXT}" | |
function cleanup { | |
echo "Cleaning the runner..." |
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 'dart:async'; | |
import 'package:flutter/material.dart'; | |
mixin PeriodicUpdater<T extends StatefulWidget> on State<T> { | |
Timer? _timer; | |
Duration get updateInterval; | |
@override |
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 React, { useState, useEffect } from "react"; | |
function App() { | |
const [value, setValue] = useState(""); | |
//Waits for a period of time then resolves | |
function timeout(ms) { | |
return new Promise((resolve) => setTimeout(resolve, ms)); | |
} |
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
function useState(initVal) { | |
let _val = initVal; | |
const state = () => _val; | |
const setState = newVal => { | |
_val = newVal; | |
} | |
return [state, setState]; | |
} | |
const [count, setCount] = useState(1); |
NewerOlder