Skip to content

Instantly share code, notes, and snippets.

View walesmd's full-sized avatar

Michael Wales walesmd

View GitHub Profile
directions = {up = {x = 0, y = -1}, down = {x = 0, y = 1}, left = {x = -1, y = 0}, right = {x = 1, y = 0}}
function love.load()
game = {}
game.width = love.graphics.getWidth()
game.height = love.graphics.getHeight()
player = {}
player.x = game.width / 2
player.y = game.height / 2
directions = {up = {x = 0, y = -1}, down = {x = 0, y = 1}, left = {x = -1, y = 0}, right = {x = 1, y = 0}}
function love.load()
game = {}
game.width = love.graphics.getWidth()
game.height = love.graphics.getHeight()
player = {}
player.x = game.width / 2
player.y = game.height / 2
directions = {up = {x = 0, y = -1}, down = {x = 0, y = 1}, left = {x = -1, y = 0}, right = {x = 1, y = 0}}
function love.load()
game = {}
game.width = love.graphics.getWidth()
game.height = love.graphics.getHeight()
game.running = true
player = {}
player.x = game.width / 2
directions = {up = {x = 0, y = -1}, down = {x = 0, y = 1}, left = {x = -1, y = 0}, right = {x = 1, y = 0}}
function love.load()
game = {}
game.width = love.graphics.getWidth()
game.height = love.graphics.getHeight()
game.running = true
player = {}
player.x = game.width / 2
<?php
class Hello extends Controller {
function index() {
$data['partial'] = 'hello/index';
$this->load->view('layout', $data);
}
}
@walesmd
walesmd / MY_Model.php
Created December 6, 2010 03:18
CodeIgniter extended Model Class
<?php if (!defined('BASEPATH')) exit('No direct script access allowed.');
/* MY_Model
* Reorganizes the $DB::result() object passed to it so joined
* tables are child-objects of the result object, rather than
* first-class variables. Pretty strict on the way it works.
*
* Example:
* protected $relationships = array(
* 'has_one' => array(
<?php
class Pages extends Controller {
function index($page) {
switch ($page) {
'plant_hire':
$this->planthire();
break;
[14:44] <maitrebn> Hi ! I'm using CI with Doctrine and I can't find any way to log error from Doctrine ...
[14:44] <walesmd> Sounds like a question for #doctrine
[14:45] <walesmd> Whatever doctrine uses to give you errors, if they don't offer a logging mechanism wrap it in CI log_error() function.
[14:46] <maitrebn> walesmd, as it's working with other framework ...
[14:46] * walesmd is not a Doctrine expert - never used it before.
[14:46] <walesmd> log_error(1, $Doctrines_variable_for_errors);
[14:46] <maitrebn> walesmd, i do not know log_error() so I'm will look !
[14:46] <walesmd> http://codeigniter.com/user_guide/general/errors.html
[14:47] <walesmd> log_message() actually
[14:47] <maitrebn> walesmd, It just stop ... I'm not sure to retreive any doctrine value ...
@walesmd
walesmd / mariadb.repo
Created May 31, 2013 19:41
wget [this_gist] -O /etc/yum.repo.d/mariadb.repo
# MariaDB 10.0 CentOS repository list - created 2013-05-31 19:29 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
@walesmd
walesmd / index.html
Created August 8, 2013 09:18
via:geojson.io
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.marker-properties {
border-collapse:collapse;