Skip to content

Instantly share code, notes, and snippets.

View erincandescent's full-sized avatar
💭
pondering the existence of this feature

Erin erincandescent

💭
pondering the existence of this feature
View GitHub Profile
oshepherd@Asuka ~/elfload
$ uname -a
CYGWIN_NT-6.1 Asuka 1.7.32(0.274/5/3) 2014-08-13 23:06 x86_64 Cygwin
oshepherd@Asuka ~/elfload
$ cat hi.c
void _start(int (*puts)(const char *s))
{
puts("Hello, world!");
}
$ git rebase ad23f89
First, rewinding head to replay your work on top of it...
': not a valid identifiertext.sh: line 88: export: `FIRSTLINE
Applying:
': not a valid identifiertext.sh: line 88: export: `FIRSTLINE
Applying:
': not a valid identifiertext.sh: line 88: export: `FIRSTLINE
Applying:
': not a valid identifiertext.sh: line 88: export: `FIRSTLINE
Applying:
@erincandescent
erincandescent / gist:6dc89082e878d53ea402
Created August 31, 2014 16:19
MSVC <thr/threads.h>
/* threads.h -- header for threads library */
#pragma once
#ifndef _THR_THREADS_H
#define _THR_THREADS_H
#ifndef RC_INVOKED
#include <thr/xthreads.h>
#pragma pack(push,_CRT_PACKING)
#pragma warning(push,3)
#pragma push_macro("new")
{
"preferredUsername": "oshepherd",
"url": "https://microca.st/oshepherd",
"displayName": "Owen Shepherd",
"links": {
"self": {
"href": "https://microca.st/api/user/oshepherd/profile"
},
"activity-inbox": {
"href": "https://microca.st/api/user/oshepherd/inbox"
_CBPRINTF(3) Library Functions Manual _CBPRINTF(3)
NAME
_cbprintf, _vcbprintf, _cbwprintf, _vcbwprintf -- formatted output
conversion by callback
SYNOPSIS
#include <stdio.h>
int _cbprintf(void *p,
@erincandescent
erincandescent / gist:bed98cbdd3fc39ed0d53
Created August 11, 2014 22:23
OK mandoc, how'd that happen?
_cbprintf(3) Library Functions Manual _cbprintf(3)
NNAAMMEE
__ccbbpprriinnttff, __vvccbbpprriinnttff, __ccbbwwpprriinnttff, __vvccbbwwpprriinnttff -- formatted output
conversion by callback
SSYYNNOOPPSSIISS
##iinncclluuddee <<ssttddiioo..hh>>
iinntt __ccbbpprriinnttff(_v_o_i_d _*_p, _i_n_t _(_*_c_b_)_(_v_o_i_d _*_p_, _c_o_n_s_t _c_h_a_r _*_b_u_f_, _i_n_t _s_i_z_e_),
@erincandescent
erincandescent / gist:9f37fd3452217b905897
Created August 7, 2014 23:44
Pump.io numbers of curiosity
_PUBLIC_ verbs and incidences, from the Pump.io firehose
N.B. this is an incomplete sample - most non-post verbs will be sent to "followers" the majority of the time
post 14116
update 916
like 1053
favorite 1629
create 847
share 17
delete 228
#ifndef UDIRECT_H
#define UDIRECT_H
#if !defined(UDIRECT_VERSION)
#error UDIRECT_VERSION must be defined(supported: 0x000)
#elif (UDIRECT_VERSION != 0x000)
#error Unsupported UDIRECT_VERSION
#endif
#ifndef _UDI_H
@erincandescent
erincandescent / NibblerCPU.vhd
Created May 20, 2014 00:59
Nibbler 4-bit CPU in VHDL
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity NibblerCPU is Port(
clk : in STD_LOGIC;
rst : in STD_LOGIC;
prog_addr : out std_logic_vector(11 downto 0);
prog_data : in std_logic_vector(7 downto 0);
@erincandescent
erincandescent / gist:8376705
Last active January 2, 2016 23:29
Quick and dirty trap on overflow overhead check
#include <stdio.h>
#include <time.h>
#include <stdint.h>
__asm(
".align 16\n"
"_overhead:\n"
"mov 4(%esp), %eax\n"
"mov $25, %ecx\n"
"1: dec %ecx\n"