Skip to content

Instantly share code, notes, and snippets.

//
// LORichTextLabel.m
// RichTextLabel
//
// Created by Locassa on 19/06/2011.
// Copyright 2011 Locassa Ltd. All rights reserved.
//
#import "LORichTextLabel.h"
#import "UIView+Layout.h"
@alonecuzzo
alonecuzzo / gist:7443632
Last active December 28, 2015 04:39
factorial code - non recursive
fact(i)
{
int f = 1;
for(j=1;j<=i;j++)
f *= j;
return f;
}
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
int arr[10] = {3, 9, 15, 3, 9, 6, 6, 3, 15, 5};
PrintSpecialAverage(arr, sizeof(arr) / sizeof(arr[0]));
}
void PrintSpecialAverage(int arr[], int arrlen)
{
fact(i)
{
return i*fact(i-1);
}
fact(i)
{
if(i > 1)
return i*fact(i-1);
else
return 1;
}
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
txtpur='\e[0;35m' # Purple
txtcyn='\e[0;36m' # Cyan
txtwht='\e[0;37m' # White
bldblk='\e[1;30m' # Black - Bold
bldred='\e[1;31m' # Red
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
if (!self.tabBarIsShowing) {
self.tabBar.hidden = YES;
}
}
@alonecuzzo
alonecuzzo / FunctionalOfFuture.swift
Last active August 29, 2015 14:26
Code from Functional Presentation
// paperlesspost.com/api/v100/event?id=3948
//{
// id: 3948,
// eventName: "The Party For the LOLZ",
// hostName: "datFoolCuzzo"
//
//}
protocol JSONDecodable {
static func decode(json: JSON) -> Self?
@alonecuzzo
alonecuzzo / curry.swift
Last active August 29, 2015 14:27
Curry Swift
//adding without currying
func add(a: Int, b:Int) -> Int {
return a + b
}
//when we use the swift curry form this is what is happening behind the scenes
func addCurry(a: Int) -> (Int -> Int) {