Skip to content

Instantly share code, notes, and snippets.

View macmade's full-sized avatar
🦄
I may be slow to respond.

JD Gadina macmade

🦄
I may be slow to respond.
View GitHub Profile
@macmade
macmade / ASM Universe
Created November 26, 2010 20:05
The whole universe, coded with 236 characters of assembly code...
BITS 16
before_big_bang:
cli
mov ax, 0x07C0
mov ds, ax
mov es, ax
@macmade
macmade / ArchInfos
Created November 26, 2010 21:12
C / System informations
#include <stdio.h>
#define XSTR(s) STR(s)
#define STR(s) #s
int main( void )
{
printf
(
"\n"
@macmade
macmade / objc-clang-warnings
Created November 18, 2011 15:00
Objective-C Clang Warning Flags
‎-Wall
-Wbad-function-cast
-Wcast-align
-Wconversion
-Wdeclaration-after-statement
-Wdeprecated-implementations
-Wextra
-Wfloat-equal
-Wformat=2
-Wformat-nonliteral
@macmade
macmade / BashStory
Created November 22, 2011 18:58
BashStory - When I tried to SSH my girlfriend
Girlfriend/BSD
Login: love
Password:
Login incorrect
Login: boyfriend
Password:
int * x;
int * y;
int z;
x = ( int * )calloc( 10, sizeof( int ) );
y = &( x[ 5 ] );
x = ( int * )realloc( x, 20 * sizeof( int ) );
z = *( y );
- ( void )actionSheet: ( UIActionSheet * )actionSheet clickedButtonAtIndex: ( NSInteger )buttonIndex
{
NSLog( @"%i", buttonIndex );
if( buttonIndex == 0 )
{
SettingsView * settings = [ [ SettingsView alloc ] initWithNibName: @"SettingsView" bundle: nil ];
NSLog( @"%@", settings );
NSLog( @"%@", self.navigationController );
[ self.navigationController pushViewController: settings animated: YES ];
[ settings release ];

Coding Guidelines for Cocoa

Tips and Techniques for Framework Developers

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CodingGuidelines/Articles/FrameworkImpl.html#//apple_ref/doc/uid/20001286-BAJIBFHD

Object Sizes and Reserved Fields

Each Objective-C object has a size that can be determined by the total size of its own instance variables plus the instance variables of all superclasses. You cannot change the size of a class without requiring the recompilation of subclasses that also have instance variables. To maintain binary compatibility, you usually cannot change object sizes by introducing new instance variables into your classes or getting rid of unneeded ones.

@macmade
macmade / girlfriend.class.php
Created January 3, 2012 06:53
A PHP class representing a girl...
<?php
require_once( 'city.class.php' );
abstract class core_girlFriend
{
private $_mood = false;
private $_wrongMoods = array( 'busy', 'anxious', 'worried', 'working', 'sad', 'melancholic' );
private $_city = null;
@macmade
macmade / GenericViewController
Created January 24, 2012 20:44
GenericViewController
@interface GenericViewController: UIViewController
{}
@end
@implementation GenericViewController
{
- ( id )init
{
NSString * className;
@macmade
macmade / Clang - LLVM MakeFile
Created June 11, 2012 20:05
Clang - LLVM MakeFile
#-------------------------------------------------------------------------------
# Build settings
#-------------------------------------------------------------------------------
PREFIX = /usr/local/my-llvm/
#-------------------------------------------------------------------------------
# Software
#-------------------------------------------------------------------------------