Skip to content

Instantly share code, notes, and snippets.

View lighth7015's full-sized avatar
Perpetually exhausted.

Robert Butler lighth7015

Perpetually exhausted.
View GitHub Profile
@lighth7015
lighth7015 / README.md
Last active January 12, 2020 03:10
Proposed Class Hierarchy
Class Name			Base class (optional)	Class Description
Drawable						Base drawable interface.
	Window						Base UI class.
		BasicWindow				A Basic Window
		ChildWindow				Subclass of basicwindow for use with MDI 
							applications

	Control						Basic control interface, is both renderable and

discoverable.

@lighth7015
lighth7015 / AppMain.ec
Last active January 13, 2020 19:09
AppMain (ec)
import "ecere"
import "DefaultSkin"
import "EDA"
class AppMain: GuiApplication {
skin = "App";
Database handle;
DataSource source { driver = "SQLite" };
@lighth7015
lighth7015 / VFS.ec
Last active January 14, 2020 20:07
VFS store class
import "ecere"
#include <unistd.h>
#include <limits.h>
#include <stdlib.h>
private class VFSoot: struct {
char signature[6];
uint16_t file_length;
const char* creator;
@lighth7015
lighth7015 / idb.md
Created January 15, 2020 21:27
IDB file format

Magic number: "IDB" \r \n NULL Version: 0x01 Flags: is_big_endian Length of Schemas

Target AS String /* used to identify which program this is for, the / / host program can provide implicit schemas. */

OPTIONAL Schemas OF { Schema_size AS UInt8

@lighth7015
lighth7015 / idb.txt
Created January 15, 2020 21:27
IDB file format
Magic number: "IDB" \r \n NULL
Version: 0x01
Flags: is_big_endian
Length of Schemas
Target AS String /* used to identify which program this is for, so */
/* the host program can provide implicit schemas. */
OPTIONAL Schemas OF {
Schema_size AS UInt8
@lighth7015
lighth7015 / log.txt
Created January 16, 2020 22:13
systemd-analyze critical-chain
graphical.target @3min 9.112s
└─multi-user.target @3min 9.112s
└─smb.service @1min 41.461s +9.757s
└─winbind.service @1min 32.664s +8.793s
└─nmb.service @1min 10.561s +22.099s
└─network-online.target @1min 10.426s
└─NetworkManager-wait-online.service @43.699s +26.726s
└─NetworkManager.service @36.336s +7.356s
└─dbus.service @36.329s
└─basic.target @36.319s
@lighth7015
lighth7015 / newvfs.ec
Created January 19, 2020 07:20
WIP: VFS
#define DEFAULT_DIR_MODE S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH // 0755
#define BLOCKSIZE 512
#define BLOCKING_FACTOR 20
#define RECORDSIZE 10240
// file type values (1 octet)
#define REGULAR 0
#define NORMAL '0'
#define HARDLINK '1'
@lighth7015
lighth7015 / elf-module-i386.c
Last active January 30, 2020 00:51
ELF loader
/**
* ELF loadable modules
*
* Architecture-dependend functions for x86.
*
* 12 Feb 2011, Yury Ossadchy
**/
#include "elf-module-private.h"
int elf_module_check_machine(elf_module_t *elf)
@lighth7015
lighth7015 / loader.c
Last active February 1, 2020 22:13
ELF loader
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <libelf.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <dlfcn.h>
#include <fcntl.h>
@lighth7015
lighth7015 / Makefile
Created February 4, 2020 16:52
write-col
EQT:="
# function?
define write-col
$(shell printf $(EQT) printf \"%-$(1)s\"\n$(EQT) $(EQT)$(2)$(EQT)
endef
test:
$(info $(EQT)A $(write-col 12 "foo") B $(EQT))