Skip to content

Instantly share code, notes, and snippets.

View codecowboy's full-sized avatar

Luke Mackenzie codecowboy

  • UK
View GitHub Profile
@codecowboy
codecowboy / gist:2282102
Created April 2, 2012 09:31
ironworker log
View gist:2282102
No entry for terminal type "unknown";
using dumb terminal settings.
Populating jobs from BR
Populating jobs from CA
Populating jobs from US
Populating jobs from NL
Populating jobs from NO
Populating jobs from ZA
Populating jobs from ES
Populating jobs from SE
@codecowboy
codecowboy / gist:2282089
Created April 2, 2012 09:29
ironworker
View gist:2282089
<?php
/*IRON_WORKER_HEADER*/
function getArgs(){
global $argv;
$args = array('task_id' => null, 'dir' => null, 'payload' => array());
foreach($argv as $k => $v){
if (empty($argv[$k+1])) continue;
if ($v == '-id') $args['task_id'] = $argv[$k+1];
if ($v == '-d') $args['dir'] = $argv[$k+1];
if ($v == '-payload' && file_exists($argv[$k+1])){
@codecowboy
codecowboy / gist:1451435
Created December 9, 2011 12:58
search page
View gist:1451435
<%@ Page Title="" Language="C#" MasterPageFile="~/Content.master" AutoEventWireup="true" CodeFile="search.aspx.cs" Inherits="footer_search" %>
<asp:Content ID="Content8" ContentPlaceHolderID="searchScript" Runat="Server">
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
@codecowboy
codecowboy / gist:1451400
Created December 9, 2011 12:48
Search form page
View gist:1451400
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="home.aspx.cs" Inherits="home" Title="-removed- 15th Anniversary Website -Home Page" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="/library/js/jquery.js"></script>
<script type="text/javascript" src="/library/js/hoverIntent.js"></script>
<script type="text/javascript" src="/library/js/superfish.js"></script>
@codecowboy
codecowboy / gist:1324206
Created October 29, 2011 07:34
DefaultController
View gist:1324206
public function indexAction()
{
$user = $user = $this->get('security.context')->getToken()->getUser();
$challenge = $this->getDoctrine()
->getRepository('GymloopCoreBundle:Challenge')
->find(1);
if(!$challenge) {
throw $this->createNotFoundException('No challenge found');
@codecowboy
codecowboy / gist:1261012
Created October 4, 2011 06:20
Change password form
View gist:1261012
<div id="change_password_wrapper">
<h2>Change your password</h2>
<form action="{{ path('fos_user_change_password') }}" {{ form_enctype(form) }} method="POST" class="fos_user_change_password">
{%if form_errors(form)%}
<div class="ui-state-error ui-corner-all">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
<strong>Error:</strong>
{{ form_errors(form) }}
</p>
@codecowboy
codecowboy / gist:1260992
Created October 4, 2011 05:52
Profile Form Handler
View gist:1260992
<?php
/*
* This file is part of the FOSUserBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@codecowboy
codecowboy / gist:1258990
Created October 3, 2011 12:24
controller
View gist:1258990
<?php
namespace Gymloop\ChallengeBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Gymloop\CoreBundle\Entity\Challenge;
use Gymloop\CoreBundle\Entity\ChallengeCoordinates;
class DefaultController extends Controller