Skip to content

Instantly share code, notes, and snippets.

View ftdysa's full-sized avatar

Fred Dysart ftdysa

  • Automox
  • Denver, CO
View GitHub Profile
<?php
namespace Ibms\Helper;
use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables as BaseGlobalVariables;
use Symfony\Component\DependencyInjection\ContainerInterface;
use DateTime;
class GlobalVariables extends BaseGlobalVariables
{
<?php
namespace Ibms\JobBundle\Twig;
use Doctrine\Common\Collections\Collection;
use Ibms\JobBundle\Entity\Job;
use Ibms\JobBundle\Entity\JobAppliance;
use Ibms\UserBundle\Entity\Technician;
use DateTime;
use Symfony\Component\DependencyInjection\ContainerInterface;
{% stylesheets '@MynatnetWebsiteBundle/Resources/less/mynatnet.less' %}
<link rel="stylesheet" href="{{ asset_url }}">
{% endstylesheets %}
@ftdysa
ftdysa / gist:8012924
Created December 17, 2013 21:30
sig alarm
eval {
local $SIG{ALRM} = sub { die "timed out" };
alarm 5; # 5 seconds
# do something
alarm 0; # Clears alarm.
};
public function getFunctions() {
return array(
'tabs' => new \Twig_Function_Method($this, 'toTabs', array('needs_environment' => true))
);
}
public function toTabs(\Twig_Environment $environment, array $data) {
return $environment->render('MyBundle:Layout:tabs.html.twig', array('tabs' => $data));
}

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

{% extends 'MynatnetWebsiteBundle:Ticket:view.html.twig' %}
{% block ticket_details %}
<h2>Ticket Details</h2>
<table class="ticket-details">
<tbody>
<tr>
<th>Account ID</th>
<td>{{ account.id }}</td>
{% macro display_selectize(form) %}
{% set csv = "" %}
{% for tag in form %}
{% set csv = csv ~ tag.vars.value.getName() ~ ", " %}
{% endfor %}
{% spaceless %}
<div class="form-group" id="{{ form.vars.name }}-container">
<label for="{{ form.vars.id }}">{{ form.vars.label }}</label>
<input type="text" id="{{ form.vars.id }}" class="tags" value="{{ csv }}" data-prototype="{{ _self.hidden_prototype(form.vars.prototype.children)|e }}" data-container="tags-container" />
</div>
<?php
class TailRecursion
{
public $func;
public $acc;
public $recursing;
public function tail()
{
return call_user_func_array($this->func, func_get_args());
<?php
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* @Entity
*/
class Document
{