Skip to content

Instantly share code, notes, and snippets.

View florieger's full-sized avatar

Florian Rieger florieger

View GitHub Profile
@florieger
florieger / .htaccess
Last active January 24, 2021 18:31
AppCron HTTPS forward with Auth
RewriteEngine On
# AppCron HTTPS forwarder
<If "%{HTTPS} != 'on'">
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</If>
<Else>
# Authentication
@florieger
florieger / .htaccess
Last active July 22, 2019 10:56
AppCron HTTPS forward
# AppCron HTTPS forward
RewriteEngine On
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
@florieger
florieger / ACAppDelegate-macOS
Last active September 10, 2020 14:25
Swift AppDelegate without Storyboard / XIB for iOS.
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
var window: NSWindow?
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
mainWindowController = MainWindowController()
mainWindowController?.showWindow(self)
}
@florieger
florieger / ACAppDelegate-iOS
Last active August 27, 2020 09:21
Swift AppDelegate without Storyboard / XIB for iOS.
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window?.backgroundColor = UIColor.black
window?.rootViewController = ViewController()
window?.makeKeyAndVisible()
@florieger
florieger / ACViewController.swift
Last active March 12, 2019 09:09
Swift ViewController without Storyboard / XIB.
class ACViewController: UIViewController {
let frame: CGRect
let childViewController: UIViewController
var imageView: UIImageView?
// MARK: Init
init(frame: CGRect) {
self.frame = frame
@florieger
florieger / functions.php
Last active December 15, 2015 22:00
Wordpress custom image sizes.
<?php // This File will be read by the wordpress engine, handle with care
// ========== AppCron Image Handling ==========
// Remove default image sizes
function ac_remove_image_sizes( $sizes) {
unset( $sizes['thumbnail']);
unset( $sizes['medium']);
unset( $sizes['large']);
@florieger
florieger / functions.php
Created April 21, 2012 11:37
Remove output of WordPress head
<?php // This File will be read by the wordpress engine, handle with care
// =============== Remove some output of the wp_head() function ===============
remove_action( 'wp_head', 'wp_generator' ); // Remove the WP version in the generator tag
remove_action( 'wp_head', 'feed_links', 2 ); // Remove the links to the general feeds: Post, Comment and Alternate feed
remove_action( 'wp_head', 'feed_links_extra', 3 ); // Remove the links to the extra feeds such as category feeds
//remove_action( 'wp_head', 'rsd_link' ); // Remove the link to the Really Simple Discovery service endpoint, EditURI link
//remove_action( 'wp_head', 'wlwmanifest_link' ); // Remove the link to the Windows Live Writer manifest file
@florieger
florieger / ImageLoader.m
Created April 11, 2012 14:22
Memory Efficient Image Loading
#pragma mark -
#pragma mark Memory Efficient Image Loading
+ (UIImage*)imageWithContentsOfFilename:(NSString*)filename
{
NSMutableString* path = [NSMutableString stringWithString:[[NSBundle mainBundle] bundlePath]];
[path appendString:@"/"];
[path appendString:filename];
return [UIImage imageWithContentsOfFile:path];
}
#import <QuartzCore/QuartzCore.h>
self.view.layer.masksToBounds = NO;
self.view.layer.shadowColor = [[UIColor blackColor] CGColor];
// Offset to bottom, left
self.view.layer.shadowOffset = CGSizeMake(-1,1);
self.view.layer.shadowRadius = 10;
self.view.layer.shadowOpacity = 1;
@florieger
florieger / CustomizeTabBar.m
Created December 2, 2011 11:49
UITabBar Customizing
- (void)customizeTabBar
{
UIImage* tabBarBackground = [UIImage imageNamed:@"tabbar.png"];
[[UITabBar appearance] setBackgroundImage:tabBarBackground];
UIImage* selectionIndicator = [UIImage imageNamed:@"selection-tab.png"];
[[UITabBar appearance] setSelectionIndicatorImage:selectionIndicator];
}