Skip to content

Instantly share code, notes, and snippets.

View mmick66's full-sized avatar
🎸
Always on the Lookout for Gigs

Michael Michailidis mmick66

🎸
Always on the Lookout for Gigs
View GitHub Profile
import 'reflect-metadata';
const RUNNING = Symbol("RUNNING");
export function NoOverlap(): MethodDecorator {
return function (target, key?, descriptor?:TypedPropertyDescriptor<any>) {
const origFn = descriptor.value;
if (!Reflect.hasMetadata(RUNNING, target, key)) {
Reflect.defineMetadata(RUNNING, false, target, key);
}
/*
* Bezier.swift
* Created by Michael Michailidis on 16/10/2017.
* http://blog.karmadust.com/
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
/*
* Matrix.swift
* Created by Michael Michailidis on 16/11/2016.
* http://blog.karmadust.com/
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@mmick66
mmick66 / NSMutableArray+Random.h
Last active June 6, 2016 15:26
Extension to the NSMutableArray class to provide randomization functions
#import <Foundation/Foundation.h>
@interface NSMutableArray (WSRandom)
- (id) objectAtRandomIndex;
- (void) shuffle;
rm -rf install_*
rm -rf output-*
${LIB_VERSION:=1.2.8}
${TARBALLDIR:=`pwd`}
${SRCDIR:=`pwd`}
LIB_TARBALL=$TARBALLDIR/zlib-$LIB_VERSION.tar.gz
LIB_SRC=$SRCDIR/zlib-${LIB_VERSION}
@mmick66
mmick66 / UICollectionViewFlowLayoutCenterItem.m
Last active August 2, 2022 10:06
UICollectionViewFlowLayout with arbitrary sized Paging
#import "UICollectionViewFlowLayoutCenterItem.h"
@implementation UICollectionViewFlowLayoutCenterItem
- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity
{
CGSize collectionViewSize = self.collectionView.bounds.size;
CGFloat proposedContentOffsetCenterX = proposedContentOffset.x + self.collectionView.bounds.size.width * 0.5f;
CGRect proposedRect = self.collectionView.bounds;