This file contains 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
package asyncutils | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"runtime/debug" | |
) | |
// A Future is a task which starts but doesn't block the current thread since it's run in a goroutine. |
This file contains 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
FROM golang:1.16-buster AS base | |
RUN apt-get update | |
RUN apt-get install software-properties-common git build-essential curl unzip nano -y | |
# Install global CLI tools | |
RUN go install -v golang.org/x/tools/[email protected] | |
RUN go install -v github.com/go-delve/delve/cmd/[email protected] | |
RUN go install -v github.com/ramya-rao-a/[email protected] | |
RUN go install -v github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest |
This file contains 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(MaterialApp( | |
home: MyApp(), | |
)); | |
} | |
class MyApp extends StatefulWidget { | |
@override |
This file contains 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
abstract class State {} | |
class StateA implements State {} | |
final state = StateA(); | |
void main() { | |
print(state is State); | |
} |
This file contains 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
abstract class State {} | |
class StateA implements State { | |
StateA({this.name = "Hello"}); | |
final String name; | |
} | |
class StateB implements State {} | |
class StateHandlerNotWorking { |
This file contains 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
String t() { | |
try { | |
return "try"; | |
} finally { | |
return "finally"; | |
} | |
} | |
void main() { | |
print(t()); |
This file contains 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
// .prettierrc.js | |
module.exports = { | |
printWidth: 120, | |
useTabs: true, | |
semi: true, | |
singleQuote: true, | |
trailingComma: 'all', | |
bracketSpacing: true, | |
jsxBracketSameLine: false, | |
// Might have some problems with this one because of eslint |
This file contains 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
// @flow strict-local | |
import { | |
type ComponentType, | |
type ElementConfig | |
} from 'react'; | |
import type Jss from '../../packages/webapp/node_modules/jss/src/Jss'; | |
import type SheetsRegistry from '../../packages/webapp/node_modules/jss/src/SheetsRegistry'; | |
import { type generateClassName } from '../../packages/webapp/node_modules/jss/src/types/jss'; |
This file contains 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
public class Grp45_ueb01 { | |
public static void main(String[] args) { | |
final int MIN = -1000; | |
final int MAX = 25; | |
final int DIGIT_COUNT = getDigitCount(MAX); | |
for (int i = MIN; i <= MAX; i++) { | |
boolean isSmithNumber = Grp45_ueb01.isSmithNumber(i); | |
boolean isFermatNumber = Grp45_ueb01.isFermatNumber(i, 0); | |
boolean isCatalanNumber = Grp45_ueb01.isCatalanNumber(i, 0); |
This file contains 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
// Importieren des FileSystem module | |
const fs = require('fs'); | |
// Zum lesen einer Datei: | |
const datei = fs.readFileSync(pfad, 'utf-8'); | |
// Zum schreiben in eine Datei: | |
// Hierbei wird die komplette Datei überschrieben! | |
fs.writeFileSync(pfad, neuerContent, 'utf-8'); |
NewerOlder