Skip to content

Instantly share code, notes, and snippets.


Jermaine Oppong graphicbeacon

View GitHub Profile
graphicbeacon / main.dart
Last active Jun 26, 2020
Flutter Grid example with highlighted square
View main.dart
import 'package:flutter/material.dart';
void main() {
debugShowCheckedModeBanner: false, home: Scaffold(body: BoxApp())));
class BoxApp extends StatefulWidget {
BoxAppState createState() => BoxAppState();
graphicbeacon / index.html
Created Jun 20, 2020
Centering card with Materialize example
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="">
<!-- Compiled and minified JavaScript -->
graphicbeacon / console.dart
Last active Jun 18, 2020
Final snippets for "How to use JavaScript libraries in your Dart applications" article
View console.dart
// web/console.dart
library console;
import 'package:js/js.dart';
external void log(dynamic str);
graphicbeacon / chat-server.js
Last active Jun 8, 2020
A simple TCP chat server with NodeJS, based on the example provided by creationix.
View chat-server.js
var net = require('net');
var sockets = [];
var port = 8000;
var guestId = 0;
var server = net.createServer(function(socket) {
// Increment
socket.nickname = "Guest" + guestId;
graphicbeacon / index.js
Last active Jun 4, 2020
How to handle the POST request body without using a framework
View index.js
const http = require('http');
const { parse } = require('querystring');
const server = http.createServer((req, res) => {
if (req.method === 'POST') {
collectRequestData(req, result => {
res.end(`Parsed data belonging to ${result.fname}`);
graphicbeacon / server.dart
Created May 25, 2020
Shelf Dart Tutorial solution code
View server.dart
import 'dart:io';
import 'package:shelf/shelf.dart' as shelf;
import 'package:shelf/shelf_io.dart' as io;
// For Google Cloud Run, set _hostname to ''.
const _hostname = 'localhost';
const _port = 8080;
void main(List<String> args) async {
graphicbeacon / index.html
Last active May 20, 2020
WebAssembly in Dart for web example
View index.html
<!DOCTYPE html>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="scaffolded-by" content="" />
<link rel="stylesheet" href="styles.css" />
graphicbeacon / Dockerfile
Created May 17, 2020
Setup Dart with Docker
View Dockerfile
# ./Dockerfile
FROM google/dart-runtime
graphicbeacon / main.dart
Created Mar 19, 2020
"Learn Dart Before you Flutter" Youtube video solution
View main.dart
class Order {
var _id;
var _reference;
var date;
var code;
List<String> bookings;
Order(this._id, this._reference, {});
Order.withDiscount(this._id, this._reference, [this.code]) {
date =;
graphicbeacon / main.dart
Last active Mar 22, 2020
Flutter GestureDetector example - draggable square
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Padding(
// padding: const EdgeInsets.only(top: 20, left: 20, right: 20),
padding: const EdgeInsets.all(0),
child: Page()
You can’t perform that action at this time.