Skip to content

Instantly share code, notes, and snippets.

View mikevoyt's full-sized avatar

Mike V mikevoyt

View GitHub Profile
@mikevoyt
mikevoyt / main.go
Created August 19, 2016 04:39
convert a string of hex characters into a string suitable for a C array initializer
package main
import (
"fmt"
"os"
)
func main() {
str := os.Args[1]
@mikevoyt
mikevoyt / gist:4613982
Last active February 8, 2023 12:52
Example of how to create a pinned header with UICollectionView (i.e., a header that doesn't scroll with the rest of the cells). As simple as possible - assumes a single header, at index path [0,0], to be pinned at the top of the collection view.
//Override UICollectionViewFlowLayout class
@interface FixedHeaderLayout : UICollectionViewFlowLayout
@end
@implementation FixedHeaderLayout
//Override shouldInvalidateLayoutForBoundsChange to require a layout update when we scroll
- (BOOL) shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds {
return YES;
}