Skip to content

Instantly share code, notes, and snippets.

View AndresR173's full-sized avatar

Andres Rojas AndresR173

View GitHub Profile
@AndresR173
AndresR173 / nodejs-tcp-example.js
Created January 7, 2021 18:12 — forked from tedmiston/nodejs-tcp-example.js
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@AndresR173
AndresR173 / http_service.dart
Created May 19, 2021 15:55
Http wrapper for Dart
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import '../../utils/constants.dart';
import '../../utils/error/failure.dart';
import '../../utils/extensions/extensions.dart';
import '../../utils/injection_container.dart';
@AndresR173
AndresR173 / Box.swift
Created June 1, 2021 21:48
Boxing Technique
import Foundation
final class Box<T> {
typealias Listener = (T) -> Void
var listener: Listener?
var value: T {
didSet {
listener?(value)
}
import 'package:flutter/material.dart';
class CurvePainter extends CustomPainter {
final Color paintColor;
CurvePainter(this.paintColor);
@override
void paint(Canvas canvas, Size size) {
final paint = Paint();