Skip to content

Instantly share code, notes, and snippets.

View colejhudson's full-sized avatar
🏎️
gotta go faster

Cole Hudson colejhudson

🏎️
gotta go faster
View GitHub Profile
extern _printf
bits 64
global _main
section .data
hello: db "Hello World", 0
section .text
_main:
extern _puts
bits 64
global _main
section .text
_main:
push rbx
mov qword [rbp-8], qword rdx
extern _puts
bits 64
global _main
section .text
_main:
push rbx
mov rdi, [rsi]

The lldb module comes with XCode hence requiring you to run xcode-select --install before being able to install the python package. Having done that, the package is located in /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/ hence symlinking the lldb folder contained therein into your python package folder, should do the trick. If you don't know which folder that is running python -m site will print out the array of such directories. Note that it seems to be written in a mix of both python 2.7 and 3.

# list the paths you can symlink into
python -m site
# symlink the lldb module into the site-packages directory
ln -s /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/ /usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/lldb
@colejhudson
colejhudson / Makefile
Last active November 9, 2024 00:03
A base Makefile for compiling swift targeted for iOS without using XCode
# Adapted from http://vojtastavik.com/2018/10/15/building-ios-app-without-xcode/
SYS_BASE := /usr/local
SYS_LIB := $(SYS_BASE)/lib
SYS_INCLUDE := $(SYS_BASE)/include
ORGANIZATION := # Organization Name
NAME := # App Name
BUNDLE := $(NAME).app

The following will compile and run in a jupyter notebook that has access to gcc:

%%bash

cat - <<EOF | gcc -xc -o temp -; ./temp
    #include <stdio.h>
    
    int main() {
 printf("Testing\n");
id product_title normalized
23603 Sycamore Row (Jake Brigance) 551.0107861936722
297 Stampede to timberline: The ghost towns and mining camps of Colorado 0.6646692233940557
id product_title normalized
23603 Sycamore Row (Jake Brigance) 551.0107861936722
14118 Superintelligence: Paths, Dangers, Strategies 529.0767018216683
41031 Ted Cruz to the Future - Comic Coloring Activity Book 486.53787152444875
33502 Grain Brain: The Surprising Truth about Wheat, Carbs, and Sugar--Your Brain\'s Silent Killers 480.5558485139022
24149 The Hormone Cure: Reclaim Balance, Sleep, Sex Drive and Vitality Naturally with the Gottfried Protocol 381.52013422818794
5711 United States History: Preparing for the Advanced Placement Examination 295.77780441035475
4477 Stop Walking on Eggshells: Taking Your Life Back When Someone You Care About Has Borderline Personality Disorder 292.4544582933845
23695 Becoming a Supple Leopard: The Ultimate Guide to Resolving Pain, Preventing Injury, and Optimizing Athletic Performance 283.1490891658677
16100 Type A+ 261.8796740172579
@colejhudson
colejhudson / Makefile
Last active February 13, 2019 20:23
Basic Makefile for building OCaml with js_of_ocaml
SRC := main.ml
BIN := index.js
MLC := ocamlfind ocamlc
MLFLAGS := -package js_of_ocaml -package js_of_ocaml-ppx -linkpkg
JSC := js_of_ocaml
build:
# Compiles OCaml to an OCaml Object
from sympy.sets import sets as syset
import sympy as sy
# A complex plane curve is the set of all complex-valued pairs
# for some non-constant function f where where we give the pair
# as input to f, f yields 0.
complex_plane = syset.ProductSet(sy.S.Complexes, sy.S.Complexes)
x = sy.Dummy('x')