Skip to content

Instantly share code, notes, and snippets.

View oelna's full-sized avatar
😔
The light inside has broken, but I still work

Arno Richter oelna

😔
The light inside has broken, but I still work
View GitHub Profile
@oelna
oelna / base36.m
Created May 11, 2014 09:54
Two functions to convert a base 10 NSNumber to a base 36 NSString and the other way around
/* Arno Richter, May 2014 */
- (NSNumber *)getIndexOf:(NSString *)c alphabet:(NSString*)string {
for(int i=0; i<[string length]; i++) {
if([c characterAtIndex:0] == [string characterAtIndex:i]) {
return [NSNumber numberWithInteger:i];
}
}
@oelna
oelna / markdown.php
Created March 30, 2014 15:29
A Parsedown wrapper to act as a drop-in replacement for PHP Markdown
<?php
/* makes the 'Markdown" function and the 'Markdown_Parser' class available to your scripts */
require( 'parsedown.php' );
@define( 'MARKDOWN_PARSER_CLASS', 'Markdown_Parser' );
@define( 'NEWLINE_TO_BREAK', true );
function Markdown($text) {