Skip to content

Instantly share code, notes, and snippets.

# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv
@lorentey
lorentey / Atomics.md
Last active April 16, 2020 22:28
[pitch] Low-Level Atomic Operations ⚛︎
@DougGregor
DougGregor / swift_cxx_interop_first_steps.md
Created July 18, 2019 17:32
First steps for Swift/C++ interoperability

First steps for Swift/C++ Interoperability

Just a quick brain dump of "first steps" to move Swift/C++ interoperability forward. While there are many big and interesting design questions for a good interoperability story, there are also a large number of implementation tasks that can proceed independently of those design discussions (and often in parallel). This list focuses on those implementation tasks:

  1. (DONE) Add a flag -enable-cxx-interop to the frontend, and have it enable (Objective-)C++ mode in the Clang importer.
  2. Add a lit configuration flag to enable -enable-cxx-interop for the full Swift testsuite and fix all of the issues that prevent (Objective-)C code from being imported correctly when it's compiled as C++. The testsuite will likely need a lot of extern "C" annotations throughout it's headers---those fixes can be committed to the testsuite behind appropriate #ifdefs.
  3. Import C++ namespaces as Swift enums that have no cases (so-called "uninhabited enums") so the C++ lexical struct
@Azoy
Azoy / syscall.swift
Last active August 25, 2023 21:49
Raw system calls in Swift
// macOS x86_64 syscall works as follows:
// Syscall id is moved into rax
// 1st argument is moved into rdi
// 2nd argument is moved into rsi
// 3rd argument is moved into rdx
// ... plus some more
// Return value is stored in rax (where we put syscall value)
// Mac syscall enum that contains the value to correctly call it
enum Syscall: Int {
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 3, 2024 08:18
Swift Concurrency Manifesto
@alvincrespo
alvincrespo / gist:9e57623dcf60265bca2f
Last active August 18, 2022 17:34
fly-components/addon/components/fly-panel.js
// fly-components/addon/components/fly-panel.js
import Ember from 'ember';
import layout from '../templates/components/fly-panel';
export default Ember.Component.extend({
tagName: 'div',
classNames: ['fly-panel'],
layout: layout,
header: null,
subHeader: null,
@alvincrespo
alvincrespo / gist:f864fa846d3fc9364475
Last active August 29, 2015 14:21
fly-css-framework/src/styles/states/_panel.scss
// Components :: Panels
// Panels
//
// Panels are one the more versatile component within the Fly framework. They are used to provide visual sectioning for content. Panels provid a subtle border, and content placed within a ``.fly-panel-body`` is provided with padding.
//
// Styleguide 3.25
// Basic Panel
//
@FiloSottile
FiloSottile / 32.asm
Last active March 23, 2024 12:28
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: