Skip to content

Instantly share code, notes, and snippets.

View jackhub's full-sized avatar
🎯
Focusing

Jie Hu jackhub

🎯
Focusing
View GitHub Profile
@jackhub
jackhub / create-fat-framework.sh
Created May 13, 2021 12:09 — forked from sundeepgupta/create-fat-framework.sh
Script to create a universal or "fat" binary for an iOS framework.
#!/bin/bash
# Adapted from http://stackoverflow.com/questions/24039470/xcode-6-ios-creating-a-cocoa-touch-framework-architectures-issues/26691080#26691080
# and https://gist.github.com/cromandini/1a9c4aeab27ca84f5d79
# Create a new aggregate target.
# For the automatically generated scheme, change its build config to "release".
# Ensure this target's "product name" build setting matches the framework's.
# Add a run script with `source "${PROJECT_DIR}/path_to_this_script`
@jackhub
jackhub / gist:a5aefa66c81c93821718e3c6339ebd66
Created December 17, 2020 13:37 — forked from AndrewScheidecker/gist:930f4a6e0966b8421806
A stupid C++ trick for defining structs with metadata (serializers, printers, etc) without redundant declarations of members
#include <iostream>
#include <vector>
#include <string>
using std::string;
/*
These macros define a struct with an implicitly defined Show function that visits each member.
The trick is that a typedef is split between each STRUCT_MEMBER instance and the preceding macro,
which allows it to define an empty struct type that identifies the following struct member, while also
knowing the struct type that the preceding macro is using to identify the current member.
@jackhub
jackhub / CGFontToFontData.m
Created June 29, 2020 07:29 — forked from Bokugene/CGFontToFontData.m
Read Table Data from a CGFont, then wrap them into a OTF/TTF font.
typedef struct FontHeader {
int32_t fVersion;
uint16_t fNumTables;
uint16_t fSearchRange;
uint16_t fEntrySelector;
uint16_t fRangeShift;
}FontHeader;
typedef struct TableEntry {
uint32_t fTag;
@jackhub
jackhub / GitHub-Forking.md
Created February 22, 2019 05:01 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j