Skip to content

Instantly share code, notes, and snippets.

View cosinus84's full-sized avatar

Cosinus cosinus84

  • Brasov
View GitHub Profile
We couldn’t find that file to show.
@cosinus84
cosinus84 / singleton.dart
Created March 18, 2019 13:04 — forked from theburningmonk/singleton.dart
Using Dart's factory constructor feature to implement the singleton pattern
class MyClass {
static final MyClass _singleton = new MyClass._internal();
factory MyClass() {
return _singleton;
}
MyClass._internal() {
... // initialization logic here
}
mac port: sudo lsof -i tcp:3000
Alert.alert(
'SliQuote',
this.state.error,
[
{ text: 'OK', onPress: () => console.log('OK Pressed') },
],
{ cancelable: false }
);
}, 1);
@cosinus84
cosinus84 / 0_reuse_code.js
Created April 26, 2017 15:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console