Skip to content

Instantly share code, notes, and snippets.

View 12Me21's full-sized avatar
💭
any depth

12 12Me21

💭
any depth
  • ‭​ ⇠ check out my badges
  • X @lOgoUt
View GitHub Profile
@12Me21
12Me21 / pal.c
Created May 31, 2022 17:32
run like: cat source.png dest.png | a.out >out.png
#include <stdio.h>
#include <stdint.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
typedef uint32_t U32;
typedef uint8_t U8;
-- iterator function, returns: name, message, room, hour, minute
function chatlines(file)
local name, hour, minute, room
return function()
local space, name2, hour2, minute2, room2, message
local line = file:read()
if not line then return end
_, _, space, name2, hour2, minute2, room2, message = line:find("^(%s*)([A-Za-z0-9_]-)%[(%d%d):(%d%d)%](.): (.*)$")
if space then
name, hour, minute, room = name2, tonumber(hour2), tonumber(minute2), room2
-- Usage:
-- input chatlog files on stdin, outputs formatted logs on stdout
-- (name<tab>message\n), with all lines of multiline messages labelled with usernames
-- Pass a list of usernames to filter as arguments (optional)
-- iterator function, returns: name, message, room, time (in minutes)
function chatlines(file, ...)
local name, hour, minute, room
local names
if #{...}>0 then
?"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
7001 0000
9425 DCA0 0880 0001
7001 0001
7001 0001
7001 0001
7001 0001
9425 DD0C 0880 0004
9425 D50C 0880 0000
7001 000F
9425 D554 0880 0001
CEF8,659.1666666666666*36,MID$
CF64,3*36,INSTR
CF88,1*36,SUBST$
CFAC,1*36,INKEY$
CFD0,1*36,PUSH
CFF4,1*36,UNSHIFT
D018,1*36,CLS
D03C,1*36,LOCATE
D060,1*36,COLOR
D084,1*36,ATTR
7048 ABS
DBC8 ACCEL
DC7C ACLS
7059 ACOS
E37C ARYOP
703F ASC
7058 ASIN
705A ATAN
D578 ATTR
DCE8 BACKCOLOR
@12Me21
12Me21 / 8x.js
Created May 25, 2019 03:47
heck
// Create your own language definition here
// You can safely look at other samples without losing modifications.
// Modifications are not saved on browser refresh/close though -- copy often!
return {
// Set defaultToken to invalid to see what you do not tokenize yet
// defaultToken: 'invalid',
ignoreCase: true,
defaultToken: "invalid",
outdentTriggers: ["D","E","F","L","T","P"],
'
' SOFT KEYBOARD + HELP + CMPL + GUIDE
'
' ※プログラム内に含まれるいくつかの命令はシステム専用命令で通常実行環境では使えません
'
' 2018.11.06:UISTATE
' 2018.11.07:TOUCH(FRAME COUNTER),UIMASK
' 2018.11.08:確認方法の間違いを直してもらったので見直してコメント追加
' 2018.11.09:CTRLKEYボタン追加
' 2018.11.15:UIGETCMPL
var keyregex = /\b3*([A-HJ-NP-TV-Z1-9]{1,8})\b/g;
function sanitize(text){
return text.replace(/&/g,"&amp;").replace(/</g,"&lt;");
}
function size(bytes){
var suffix = "B";
if(bytes/1024 >= 1){
suffix = "KB";