Skip to content

Instantly share code, notes, and snippets.

@Raistlfiren
Raistlfiren / openMap.js
Created Nov 10, 2014
Plot points on map in Openlayers with USGS and Google Maps Support
View openMap.js
/*
* @var lat = latitude
* @var lng = Longitude
* @var id = plotting multiple maps on a map
* If you are just using one map, you can remove the ID from here
* Logical function to plot points on openlayers map with support of USGS and Google Maps
*/
function openMap(lat, lng, id) {
var layer;
View gist:afe0a82602c35f2c1bea
{# Navigation Template - Output Template you created as menu #}
{{ knp_menu_render('CoreBundle:Builder:mainMenu',
{
'template': 'CoreBundle:partials:knp_menu.html.twig',
'currentClass': 'nav-active'
})
}}
{# knp_menu.html.twig #}
@Raistlfiren
Raistlfiren / deploy.rb
Created Nov 10, 2015
app/config/deploy.rb
View deploy.rb
set :application, "Test Application"
set :domain, "domain.com"
set :deploy_to, "/home/user/www/directory"
set :app_path, "app"
set :repository, "git@github.com/..."
set :scm, :git
set :scm_verbose, :true
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`
@Raistlfiren
Raistlfiren / collection.php
Created Nov 19, 2015
Form with Form Collection....
View collection.php
<?php
namespace Test\VehicleBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class LicensesFormType extends AbstractType
{
View taxonomies.php
<?php
if (isset($taxonomy['listing_records'])) {
$amount = $taxonomy['listing_records'];
} else {
$amount = $app['config']->get('general/listing_records');
}
if (isset($taxonomy['listing_sort'])) {
$amount = $taxonomy['listing_sort'];
View cartHandler.php
<?php
public function storeInSession()
{
if (! $this->session->isStarted()) {
$this->session->start();
$this->initializeCart($this->session);
} else {
if (! $this->session->has('cart')) {
$this->initializeCart($this->session);
View CartExample.php
<?php
namespace FrontEnd\CartBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* CartItem
*
* @ORM\Table()
View service.php
<?php
use Doctrine\Common\Persistence\ObjectManager;
class Lead
{
protected $POST_Data;
protected $_em;
View Passwords.php
<?php
//UserAdmin Form
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('email', 'email', array('label' => 'form.email', 'translation_domain' => 'FOSUserBundle'))
->add('username', null, array('label' => 'form.username', 'translation_domain' => 'FOSUserBundle'))
View form.php
<?php
public function buildForm(FormBuilderInterface $builder, array $options)
{
if ($options['required']) {
$placeholder = 'test';
} else {
$placeholder = 'nope';
}