Skip to content

Instantly share code, notes, and snippets.

View glemiere's full-sized avatar

glemiere glemiere

  • The Matrix
View GitHub Profile
@glemiere
glemiere / package.json
Last active March 29, 2022 10:21
NPM Scripts to run Cypress with Angular ng serve command or SSR build.
/**********
package.json - remove this comment before using, as JSON files don't support comments.
---------------
Simple package.json file showing how to use Cypress with Angular.
npm run cy:prod used to test production build in CI/CD.
npm run cy:staging used to test staging build in CI/CD.
npm run cy:gui used to develop tests with livereload and angular dev/live server.
---------------
Requires wait-on and concurrently NPM packages as dev dependency to work correctly.
https://www.npmjs.com/package/wait-on and https://www.npmjs.com/package/concurrently
@glemiere
glemiere / ambidextrous-header.html
Created January 6, 2020 18:52
A simple hambidextrous header with Angular and Ionic.
<ion-buttons [slot]="handed === 'right' ? 'start' : 'end'">
<ion-button (click)="toggleReorder()">
Edit <ion-icon name="create"></ion-icon>
</ion-button>
</ion-buttons>
@glemiere
glemiere / ambidextrous-list.html
Created January 6, 2020 18:54
Ambidextrous re-orderable list under Angular and Ionic.
<ion-reorder-group (ionItemReorder)="reorderItems($event)" disabled="false" #list>
<ion-item *ngFor="let item of items">
<ion-reorder [slot]="handed === 'right' ? 'start' : 'end'"></ion-reorder>
<ion-label>
{{item}}
</ion-label>
<ion-badge color="primary" [slot]="handed === 'right' ? 'end' : 'start'">
{{items.indexOf(item)}}
</ion-badge>
</ion-item>

In this folder, create a runnable macOS arm64 Mach-O executable named hello_world that prints exactly:

hello world

(with a trailing newline is OK)

Hard constraints (do not violate):

  • You MUST generate the Mach-O file completely from scratch by writing raw bytes. No copying/patching any existing binaries or templates, no cp from system binaries, no downloading, no embedding prebuilt blobs.
  • Do NOT use any compiler, assembler, linker, or tool that internally assembles/links (no clang/cc/as/ld/nasm/yasm/llvm-mc/otool as a generator, etc).
  • You MAY use basic file/byte tools only (e.g., python3 -c, printf, dd, perl, xxd, hexdump) to emit bytes, and codesign purely for ad-hoc signing.