Skip to content

Instantly share code, notes, and snippets.

View leeprobert's full-sized avatar

Lee Probert leeprobert

View GitHub Profile
@leeprobert
leeprobert / Away3DFlexApplication.mxml
Created March 22, 2012 17:48
Away3D 4 Flex application example
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:loaders="away3d.loaders.*"
xmlns:a3d="*"
backgroundAlpha="0"
@leeprobert
leeprobert / PVPixelPrecision.as
Created March 23, 2012 10:17
The code required to make an object look pixel perfect in a 3D Papervision environment
Object.z = Math.round((camera.zoom * camera.focus) -Math.abs(camera.z))
+ Object.depth/2; // take or add 0.5 if it's still blurred
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955"
minHeight="600"
@leeprobert
leeprobert / Angle.as
Created April 23, 2012 14:40
A class for drawing a block of text and then drawing an extrusion path from the bounds of the rectangle
package com.cc.math
{
/**
* Full details: http://gamedev.michaeljameswilliams.com/2009/04/24/angles-in-flash/
* Hungarian notation idea: http://www.joelonsoftware.com/articles/Wrong.html
* Optimisation credit: http://www.nbilyk.com/optimizing-actionscript-3
*
* Usage: import com.michaeljameswilliams.gamedev.angles.Angle
* var degAngle:Number = Angle.degFromRad( radAngle );
@leeprobert
leeprobert / StyleManager.swift
Last active November 5, 2015 15:00
StyleManager port to Swift 2. The class loads the plist by getting the filename from the project info.plist. The plist allows core UIKit components to be styled very easily. The StyleManager class is a Singleton and just needs to be initialised in the app delegate to style the app.
//
// StyleManager.swift
// HoboApp
//
// Created by WLD_MBP_20 on 04/11/2015.
// Copyright (c) 2015 probert. All rights reserved.
//
import UIKit
@leeprobert
leeprobert / Country.plist
Created November 12, 2015 11:23
Country and State data as plist. Thanks to https://github.com/hackiftekhar/IQCountryStateHandler
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>001</key>
<string>Afghanistan</string>
<key>002</key>
<string>Albania</string>
<key>003</key>
<string>Algeria</string>
@leeprobert
leeprobert / p5js - 3D Spikey Plane Ball.markdown
Last active November 16, 2015 10:12
Forked from [Mike Brondbjerg](http://codepen.io/brondbjerg/)'s Pen [p5js - 3D Spikey Plane
@leeprobert
leeprobert / input.scss
Created December 3, 2015 11:36
Sass file for my site on leeprobert.cc
@import url('http://weloveiconfonts.com/api/?family=entypo');
/*
VARIABLES
*/
$font-stack: 'Roboto', 'Avenir', Arial, sans-serif;
$grey-color1: #333;
$grey-color2: #444;
$grey-color3: #555;
@leeprobert
leeprobert / CollectionViewCarouselFlowLayout.m
Created March 15, 2013 11:11
UICollectionViewFlowLayout sub-class that creates layout attributes for items so they render like a carousel. The point of view is from the center of the carousel so is suited for lots of items. It also changes its behaviour based on orientation.
//
// CollectionViewCarouselFlowLayout.m
// iP2
//
// Created by Lee Probert on 07/03/2013.
//
//
#import "CollectionViewCarouselFlowLayout.h"
@leeprobert
leeprobert / CollectionViewCircleFlowLayout.m
Created March 15, 2013 11:13
UICollectionViewFlowLayout sub-class for layout attributes of all the items in a circle.
//
// CollectionViewCarouselFlowLayout.m
// iP2
//
// Created by Lee Probert on 07/03/2013.
//
//
#import "CollectionViewCircleFlowLayout.h"