Skip to content

Instantly share code, notes, and snippets.

View networkimprov's full-sized avatar
👁️

Liam networkimprov

👁️
View GitHub Profile
@networkimprov
networkimprov / txt.md
Last active March 10, 2024 22:08
Requirements to Consider for Go 2 Error Handling

Requirements to Consider for Go 2 Error Handling

Towards consensus on the requirements for a new errors idiom.

The Go2 Error Handling Overview gives only four rather vague "goals": small-footprint error checks, developer-friendly error handlers, explicit checks & handlers, and compatibility with existing code. It makes no mention of potential future extensions of the concept. Previously @ianlancetaylor made a similar list in Github issue #21161.

@networkimprov
networkimprov / txt.md
Last active December 4, 2018 19:38
Please Don't Mangle the Function Signature, re Go2 generics proposal

For gosh sakes, don't make us read code with the scrutiny of a compiler :-) A type declaration after a function name is confusingly similar to an argument list.

Which witch is which?

  • func Stuff(type T Something)(input T) error { ... }
  • func Stuffed(input Somethingelse) error { ... }

C++ style is fine; variations on paren placement can be considered

  • (type T, U) Something // line break or semicolon
    (type V) // more on next line
@networkimprov
networkimprov / txt.md
Last active September 5, 2018 22:19
Missing Multiple Error Handlers (a Revised Handler Concept), re Go2 handle/check proposal

Now posted on the golang issue tracker, #27519.

The #id/catch error model, a revision of check/handle

Appreciations to the Go team for presenting a thoughtful and detailed set of Go2 draft designs. The Error Handling Draft is great for logging errors via the handler chain, and returning them succinctly. However, Go programs commonly:

a) handle an error and continue the function that received it, and

@networkimprov
networkimprov / log.txt
Created November 4, 2015 23:18
archlinuxarm-armv7-latest on qemu boot log
[ OK ] Reached target Timers.
Starting Network Service...
[ OK ] Started Permit User Sessions.
[ OK ] Started Getty on tty1.
[ 34.455182] input: AT Raw Set 2 keyboard as /devices/platform/smb/smb:motherboard/smb:motherboard:iofpga@3,00000000/1c060000.kmi/serio0/input/input0
[ OK ] Started Login Service.
[ OK ] Found device /dev/ttyAMA0.
[ OK ] Started Serial Getty on ttyAMA0.
[ OK ] Reached target Login Prompts.
[ 35.892345] libphy: smsc911x-mdio: probed
@networkimprov
networkimprov / gist:12bf0487e5d70b483934
Created October 31, 2015 08:16
installer initramfs draft
drwxr-xr-x 11 root root 0 Oct 31 08:10 .
-rw-r--r-- 1 root root 2562 Oct 31 08:10 ./buildconfig
-rw-r--r-- 1 root root 96 Oct 31 08:10 ./config
-rwxr-xr-x 1 root root 466 Oct 31 08:10 ./sbinit.sh
-rwxr-xr-x 1 root root 679 Oct 31 08:10 ./wipek.sh
-rw-r--r-- 1 root root 4364 Oct 31 08:10 ./init
drwxr-xr-x 2 root root 0 Oct 31 08:10 ./hooks
-rwxr-xr-x 1 root root 529 Oct 31 08:10 ./hooks/udev
-rw-r--r-- 1 root root 12469 Oct 31 08:10 ./init_functions
-rw-r--r-- 1 root root 2 Oct 31 08:09 ./VERSION
var lib = require('./buglib.js');
lib.on('connect', function() {
console.log('library ready');
throw new Error('test throw');
console.log('done');
});
lib.init(null);
@networkimprov
networkimprov / stattest.js
Created October 29, 2011 18:44
Async filesystem ops vs. OS filesystem cache
var fs = require('fs');
var sMax = 500000;
var sDir = 'teststat';
var sCount = 2;
if (!fs.statSync(sDir)) {
fs.mkdirSync(sDir, 0700);
for (var a=0; a < 100; ++a)
fs.writeFileSync(sDir+'/'+a, 'some text');
@networkimprov
networkimprov / fs.utimes patch
Created March 3, 2011 03:25
may need to be rebased...
From 9f74e3f74ccb35d40ac61b24ad21b11c034df2fa Mon Sep 17 00:00:00 2001
From: Ben Noordhuis <[email protected]>
Date: Fri, 29 Oct 2010 12:38:13 +0200
Subject: [PATCH] fs.utimes() and fs.futimes() support.
---
lib/fs.js | 39 +++++++++++++
src/node_file.cc | 80 ++++++++++++++++++++++++++
test/simple/test-fs-utimes.js | 123 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 242 insertions(+), 0 deletions(-)
@networkimprov
networkimprov / style.css
Created January 28, 2011 21:41
doc/all_files/style.css with right-margin TOC pane
/*--------------------- Layout and Typography ----------------------------*/
body {
// font-family: "Helvetica Neue", Helvetica, FreeSans, Arial, sans-serif;
font-family: Georgia, FreeSerif, Times, serif;
font-size: 0.9375em;
line-height: 1.4667em;
color: #222;
margin: 0; padding: 0;
}
a {
Dependencies for elembe
Application [/home/elembe/lib/] http://github.com/networkimprov/elembe
[runs as user elembe]
Socket.IO [/home/elembe/lib/socket.io/] http://github.com/LearnBoost/Socket.IO
Node.js 0.2.5+ http://github.com/ry/node
Node modules [/usr/lib/nodelib/(module_name without 'node' prefix/suffix)]
inotify [C++] http://github.com/c4milo/node-inotify