Skip to content

Instantly share code, notes, and snippets.

peteroyle

Block or report user

Report or block peteroyle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@peteroyle
peteroyle / gist:5315918
Created Apr 5, 2013
Example of Ruby's behavior when modifying properties/values of objects/hashes passed as parameters
View gist:5315918
This test passes:
it "should tell me how params are passed" do
# that new car smell
car = Car.new
car.colour = "blue"
# this car smells like hash
car_hash = {'colour' => 'blue'}
# both cars were created blue yeah?
@peteroyle
peteroyle / gist:2659283
Created May 11, 2012
Codea Achievements Framework
View gist:2659283
--# PointSizeHelper
function pointsScaled(width)
if WIDTH == 1024 then
pointRatio = WIDTH / 10000
else
pointRatio = WIDTH / 5500
end
return width * pointRatio
@peteroyle
peteroyle / gist:2652743
Created May 10, 2012
Split Screen In Codea
View gist:2652743
--# Menu
Menu = class()
function Menu:init()
end
function Menu:draw()
if self.main then
@peteroyle
peteroyle / Noise Works
Created Apr 12, 2012
Noise Works Codea Project
View Noise Works
--# CircleMask
CircleMask = class()
function CircleMask:init(rad, sides)
-- you can accept and set parameters here
self.mesh = mesh()
local verts = {}
@peteroyle
peteroyle / Main
Created Feb 16, 2012
Rotating Sun In Codea
View Main
-- CircleMask class courtesy of Simeon (http://twolivesleft.com/Codea/Talk/profile/3/Simeon)
-- Use this function to perform your initial setup
function setup()
    print("Hello World!")
    -- params: width, sides in mesh, texture detail, image resolution, rotation speed
    sun = Sun(WIDTH*0.5, 128, 580, 52, 0.4)
end
-- This function gets called once every frame
@peteroyle
peteroyle / myapp_app
Created Dec 20, 2011
Boxgrinder Embedded Ordering Samples
View myapp_app
name: myapp_app
summary: Common configuration for running the C-Rex platform (just the application host)
post:
base:
- "echo ---- Creating home directory structures"
- "mkdir -p /home/myapp/stuff"
- "echo ---- Installing application and setting permissions"
- "chown -R myapp:myapp /home/myapp"
@peteroyle
peteroyle / BundledHelpersTest.java
Created Sep 8, 2011
Approach for bundeling string helpers into templates in Seam Render
View BundledHelpersTest.java
public class BundledHelpersTest {
@Test
public void testStringUtils() throws Exception {
testBundledHelper("TheInpu...", "@{render.abbreviate('TheInputString', 10)}");
testBundledHelper("...putSt...", "@{render.abbreviate('TheInputString', 5, 11)}");
testBundledHelper("TheInputString", "@{render.capitalize('TheInputString')}");
testBundledHelper(" TheInputString ", "@{render.center('TheInputString', 20)}");
testBundledHelper("TheInputString", "@{render.defaultString('TheInputString', 'BlahBlah')}");
testBundledHelper("BlahBlah", "@{render.defaultString('', 'BlahBlah')}");
View Boxgrinder Files Log
D, [2011-09-07T08:28:01.489667 #20442] DEBUG -- : Loading os plugins...
D, [2011-09-07T08:28:01.490619 #20442] DEBUG -- : We have 4 os plugin(s) registered
D, [2011-09-07T08:28:01.491476 #20442] DEBUG -- : - centos plugin for CentOS.
D, [2011-09-07T08:28:01.492418 #20442] DEBUG -- : - rhel plugin for Red Hat Enterprise Linux.
D, [2011-09-07T08:28:01.493452 #20442] DEBUG -- : - sl plugin for Scientific Linux.
D, [2011-09-07T08:28:01.494406 #20442] DEBUG -- : - fedora plugin for Fedora.
D, [2011-09-07T08:28:01.495450 #20442] DEBUG -- : Plugins loaded.
D, [2011-09-07T08:28:01.496466 #20442] DEBUG -- : Loading platform plugins...
D, [2011-09-07T08:28:01.497424 #20442] DEBUG -- : We have 3 platform plugin(s) registered
D, [2011-09-07T08:28:01.498449 #20442] DEBUG -- : - virtualbox plugin for VirtualBox.
View Boxgrinder Java Dev Config
name: dev_java
summary: Tools for developing Java apps
appliances:
- dev_common
- java_common
files:
"/opt":
- "http://apache.mirror.aussiehq.net.au//maven/binaries/apache-maven-3.0.3-bin.tar.gz"
- "http://bit.ly/pYsNJV"
packages:
@peteroyle
peteroyle / boxgrinder.log
Created Jun 28, 2011
CentOS 5 Jeos from BG nightly on Micro AMI in Singapore (AMI: boxgrinder-meta/fedora/15/1.6/x86_64 (ami-c8671f9a))
View boxgrinder.log
# Logfile created on Mon Jun 27 21:21:26 -0400 2011 by logger.rb/22285
D, [2011-06-27T21:21:26.810527 #869] DEBUG -- : Launching new build...
T, [2011-06-27T21:21:26.850591 #869] TRACE -- : Used configuration: --- !map:BoxGrinder::Config
:file: /root/.boxgrinder/config
:force: true
:platform_config: {}
:log_level: :info
:delivery_config: {}
You can’t perform that action at this time.