Skip to content

Instantly share code, notes, and snippets.

View florianbachmann's full-sized avatar
💭
rock n roll

Flori florianbachmann

💭
rock n roll
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<script type="text/javascript" charset="utf-8" src="phonegap-1.0.0.js"></script>
<script type="text/javascript" charset="utf-8">
function onBodyLoad() {
@florianbachmann
florianbachmann / Fire.lua
Created November 15, 2011 11:39 — forked from juaxix/Fire.lua
Towers versus Zombies by @juaxix -- LGPL - 11/2011 - Codea
Fire = class()
-- Towers versus Zombies by @juaxix
-- LGPL - 11/2011 
-- http://videojuegos.ser3d.es
-- it is a pleasure to gift this to the world 
-- thanks from heart to all the 2lifesleft team
function Fire:init(attackpower,position,model)
    self.attackpower = attackpower
    self.position    = position
    self.parent      = model
@florianbachmann
florianbachmann / gist:1798394
Created February 11, 2012 10:06 — forked from odrobnik/gist:1789418
Asynchronous Deletion
//
// DTAsyncFileDeleter.m
// DTFoundation
//
// Created by Oliver Drobnik on 2/10/12.
// Copyright (c) 2012 Cocoanetics. All rights reserved.
//
#import "DTAsyncFileDeleter.h"
@florianbachmann
florianbachmann / PSPDFWebViewController.m
Created March 7, 2012 17:55
How to write a pixel perfect backbutton in code. (stuff goes into viewDidLoad). Taken from http://pspdfkit.com
forwardBarButtonItem_ = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:self action:@selector(goForward:)];
// back button needs more treatment...
UIGraphicsBeginImageContextWithOptions(CGSizeMake(27, 22), NO, 0.0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColor(context, CGColorGetComponents([UIColor blackColor].CGColor));
CGContextBeginPath(context);
CGContextMoveToPoint(context, 8.0f, 13.0f);
CGContextAddLineToPoint(context, 24.0f, 4.0f);
CGContextAddLineToPoint(context, 24.0f, 22.0f);
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// [email protected]
// Public domain because I love you. Let me know how you use it.
//
#import <Cocoa/Cocoa.h>
@florianbachmann
florianbachmann / hack.sh
Created April 6, 2012 09:17 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@florianbachmann
florianbachmann / LICENSE.txt
Created May 17, 2012 19:38 — forked from sindresorhus/LICENSE.txt
View source - view the generated source of a page (140byt.es)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Sindre Sorhus <http://sindresorhus.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Uncrustify 0.59
#
# General options
#
# The type of line endings
newlines = auto # auto/lf/crlf/cr
# The original size of tabs in the input
//
// NSString+Cheddar.m
// Cheddar
//
// Created by Sam Soffes on 6/10/12.
// Copyright (c) 2012 Nothing Magical. All rights reserved.
//
#import "NSString+Cheddar.h"
#ifdef DEBUG
void pspdf_swizzle(Class c, SEL orig, SEL new) {
Method origMethod = class_getInstanceMethod(c, orig);
Method newMethod = class_getInstanceMethod(c, new);
if(class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) {
class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
}else {
method_exchangeImplementations(origMethod, newMethod);
}