Skip to content

Instantly share code, notes, and snippets.

jms_security_extra:
secure_all_services: false
expressions: true
security:
encoders:
Symfony\Component\Security\Core\User\User:
algorithm: sha1
iterations: 1
encode_as_base64: false
{# Widgets #}
{% block form_widget %}
{% spaceless %}
<fieldset {{ block('widget_container_attributes') }}>
{{ block('field_rows') }}
{{ form_rest(form) }}
</fieldset>
{% endspaceless %}
{% endblock form_widget %}
$builder
->add('firstName', 'text', array(
'label' => 'First Name',
'required' => false))
->add('middleName', 'text', array(
'label' => 'Middle Name',
'required' => false))
->add('lastName', 'text', array(
ssh [email protected]
[email protected]'s password:
Welcome to Ubuntu 12.10 (GNU/Linux 3.5.0-17-generic i686)
* Documentation: https://help.ubuntu.com/
Last login: Thu Mar 14 04:19:46 2013 from 75-169-63-34.slkc.qwest.net
bash: groups: command not found
I have no name!@host:~$
####################################################################################
$form = $this->createForm(new dateSelectType(), array('id'=>$id));
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('id', 'hidden')
->add('startDate', 'text',
array(
'attr' => array('class' => 'date'),
'required' => false,
SELECT a.id as id, DATE(a.startTime) AS startTime, DATE(a.endTime) AS endTime, a.startTime AS startTime1,
a.endTime AS endTime1, CONCAT(p.`first_name`, ' ', p.last_name) as `caseManager` FROM appointmentBlock a
JOIN `User` p ON p.id = a.`caseManager_id` WHERE a.startTime BETWEEN :start AND :end
GROUP BY a.startTime, a.caseManager_id
Array
(
[0] => Array
(
[id] => 1
public function getAppointmentBlocksInRange($start, $end, $agent) {
$em = $this->em;
$rsm = new ResultSetMapping();
$rsm->addScalarResult('id', 'id');
$rsm->addScalarResult('startTime', 'startTime');
$rsm->addScalarResult('startTime1', 'startTime1');
$rsm->addScalarResult('endTime', 'endTime');
$rsm->addScalarResult('endTime1', 'endTime1');
$rsm->addScalarResult('caseManager', 'caseManager');
<?php
class XmlToJson {
public function Parse ($url) {
$fileContents= file_get_contents($url);
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
$simpleXml = simplexml_load_string($fileContents);
$json = json_encode($simpleXml);
return $json;
<?php
class generateToken {
public function crypto_rand_secure($min, $max) {
$range = $max - $min;
if ($range < 0 ) { return $min; }
$log = log($range, 2);
$bytes = (int) ( $log / 8 ) + 1;
$bits = (int) $log + 1;
@jblac
jblac / 0_reuse_code.js
Created May 31, 2017 15:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console