• Stars
    star
    248
  • Rank 163,560 (Top 4 %)
  • Language
    Objective-C
  • License
    Apache License 2.0
  • Created about 14 years ago
  • Updated over 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of useful Objective-C and iOS classes.

moriarty

moriarty is a collection of small classes that are useful for Objective-C and iOS projects. The repository home is at:

https://github.com/tylerneylon/moriarty

NSObject+Be

This category is designed to help with memory management. Specifically, this makes it easy to only work with autoreleased objects outside of a small number of ownership-allowed methods. The rules suggested for use with this category are described here.

UIView+Position

This category enables you to treat one- or two-dimensional position parameters of a UIView like direct variables.

For example, this code will not compile:

myView.frame.origin.x += 10;

With this category, you can achieve the desired effect with code like this:

myView.frameX += 10;

Here's the post about this class.

BNColor

UIColor is not mutable; this class is. This also allows changes in both RGB and HSV color spaces (with conversion between the two).

Here's the post about this class.

BNPieChart

A UIView subclass for rendering very nice-looking pie charts.

Here's the post about this class.

WipeView

A UIView subclass for showing a wipe-vanish animation of an image.

This is a wipe animation (you can do them in other directions than this):

//  1.  /----\
//      |----|
//      \----/
//  2.    ---\
//        ---|
//        ---/
//  3.      -\
//          -|
//          -/
//  4.
//
//

Here's the post about this class.

LineView

A UIView subclass for rending a single line between any two points. Yes, you can do this with Quartz; this is easier to use if you just want a few visual lines without diving down into CGContextStuff functions (CG = Core Graphics).

Example:

LineView *lineView = [LineView lineFromPoint:CGPointZero toPoint:CGPointMake(20, 30)];
[self.view addSubview:lineView];

Here's the relevant blog post.

NSString+HMAC

Adds the method hmacWithKey: to NSString, which uses SHA256 to produce an authentication code (the HMAC). Use it like this:

NSString *key = @"a9bk342nziAFD234";  // Your private key.
NSString *hmac = [messageStr hmacWithKey:key];
// Now send the hmac with the message, and the server can authenticate.

CodeTimestamps

This is a set of macros that can provide line-by-line, nanosecond-resolution timing information for your app. [Here's the post about CodeTimestamps.] (http://eng.pulse.me/line-by-line-speed-analysis-for-ios-apps/)

CArray

A struct and collection of C functions to act as a fast, low-level replacement for NSMutableArray. Only appropriate in extremely time-sensitive code. Here's the post about CArray.

uncrustify.cfg

This is a config file for the uncrustify auto-formatting tool that can be used to clean up Objective-C h,m files.

Here is a sample command-line to use this config file:

/Applications/UniversalIndentGUI/indenters/uncrustify -c uncrustify.cfg -lOC -f MyFile.m -o MyFile.m

I suggest installing UniversalIndentGUI, which includes uncrustify as a component. The uncrustify library on its own appears to be questionably maintained (I could not get it to install correctly).

http://universalindent.sourceforge.net/

Here's the post about this file.

More Repositories

1

termtris

A text-based game inspired by tetris.
Lua
447
star
2

pacpac

A lua-based Pac-Man clone.
Lua
342
star
3

APIsWithLua

Sample Lua and C code to help you learn how to write Lua-based APIs.
C
107
star
4

lua_api_demo

An educational Lua module that can be used to teach or learn about Lua's C API.
C
85
star
5

explacy

A small tool that EXPLains spACY parse results. See what I did there?
Python
84
star
6

wj

bare bones work journal
Python
49
star
7

imghist

Build hue histograms and color pies from png files.
Python
44
star
8

math

A collection of open source math notes.
Jupyter Notebook
29
star
9

ed2

an ed-like text editor
C
28
star
10

video-scripts

Open source scripts for videos I publish on YouTube.
Lua
24
star
11

json_profile

Find data bottlenecks in large json objects.
Python
17
star
12

lua_c_module_demo

A short example of how to build a Lua module in C.
C
12
star
13

cstructs

Efficient low-level containers in pure C.
C
11
star
14

msgbox

A bite-sized tcp/udp library in pure C.
C
9
star
15

oswrap

a thin layer enabling cross-platform apps
C
8
star
16

calgebra

Linear algebraic algorithms in C.
C
8
star
17

dbgcheck

C library to avoid and isolate memory or thread errors.
C
6
star
18

thready

A simple message-passing thread library in C.
C
6
star
19

fh

file helper
Python
6
star
20

trees

Randomly generate low-poly trees in OpenGL on Mac OS X.
C++
4
star
21

a_star_search_demo

This is a small gui/interactive A* search demo in Lua.
Lua
4
star
22

advent_of_code

Code for http://adventofcode.com/
Lua
4
star
23

bounce-beatz

A retro table-tennis-inspired game.
Lua
4
star
24

knuth-taocp

Algorithms and coding problems from Knuth's The Art of Computer Programming.
Python
3
star
25

battleboat

Python
3
star
26

distribution_test

Quick code to test some code to generate certain random variables.
Lua
3
star
27

auto_documenter

Code to augment other code with docstrings and other explanatory verbiage.
Python
3
star
28

cstructs-json

A small C json library for use with cstructs.
C
3
star
29

bigoh_images

Images for an article explaining big-oh notation
Python
3
star
30

water

An open compiler. Play with language.
Python
2
star
31

gameshell-mac

A basic shell for mac-based OpenGL games.
C++
2
star
32

ccache

A simple LRU cache.
C
2
star
33

foocu

Scratch project for 2d game ideas
Lua
2
star
34

daily

Simple organization of things you want to do every n days
Python
2
star
35

cryptogram

An interactive Python script to help you solve your cryptograms.
Python
1
star
36

gameshell-win

A basic shell for windows OpenGL games.
C
1
star
37

book_viz

A way to visualize your reading history
Python
1
star
38

bf

A brainf*ck interpreter.
C
1
star
39

shotglass

A micro-library to make servers in Python.
Python
1
star
40

syncer

A tool to help manage evolving code dependencies.
Python
1
star
41

pumba

A compiler project.
Lua
1
star
42

7date_C

Shell command to get the current 7date, or that of a file.
C
1
star
43

at_once

A Python library to help concurrently run large data pipeline steps in a crash-friendly manner.
Python
1
star
44

dotfiles

Files with dots in their names. That makes sense.
Shell
1
star
45

cheeseburgermogrifier

Lua
1
star
46

beatz

Command-line audio track playing and editing program written in Lua
Lua
1
star
47

blackjack

A simple blackjack app to practice your strategy.
Python
1
star
48

apanga-progress

Apanga's bugs and upcoming features.
1
star
49

dvidump

A human-friendly opcode viewer for dvi files
Python
1
star