Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* ProTalk
*
* Copyright (c) 2012-2013, ProTalk
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<?php
// ...
public function buildForm(FormBuilderInterface $builder, array $options)
{
parent::buildForm($builder, $options);
$builder->add(
'email',
'email',
array(
@Bendihossan
Bendihossan / phpextensions.md
Last active June 12, 2018 21:30
I'm looking for a list of PHP extensions that are popular/essential for development; specifically ones not included in standard distributions.

Popular/Essential PHP Extensions

  • xdebug
  • INTL
  • gettext
  • PDO_*
  • APC
  • memcached
@Bendihossan
Bendihossan / ConfigurationBuilder.php
Last active December 15, 2015 17:49
Honour assets_base_urls if used
<?php
/**
* Get the RequireJS configuration options.
* @return array
*/
public function getConfiguration()
{
if ($this->useControllerForAssets && $this->container->isScopeActive('request')) {
$baseUrl = $this->container->get('request')->getBaseUrl();
$baseUrl = \ltrim($baseUrl, '/');
@Bendihossan
Bendihossan / twitter.php
Created April 13, 2013 16:06
Get tweets from twitter in less than 20 lines of PHP.
<?php
define('CONSUMER_KEY', 'your-key');
define('CONSUMER_SECRET', 'your-key');
define('TWITTER_TOKEN', 'your-key');
define('TWITTER_TOKEN_SECRET', 'your-key');
$oauth = new OAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);
$oauth->setToken(TWITTER_TOKEN, TWITTER_TOKEN_SECRET);
$oauth->fetch('https://api.twitter.com/1.1/statuses/home_timeline.json?count=10');
@Bendihossan
Bendihossan / bootbox.js
Last active August 29, 2015 14:05
Broken bootbox.js code
/**
* bootbox.js [v4.3.0]
*
* http://bootboxjs.com/license.txt
*/
// @see https://github.com/makeusabrew/bootbox/issues/180
// @see https://github.com/makeusabrew/bootbox/issues/186
(function (root, factory) {

Slack Code of Conduct

Welcome to the Cardiff Dev Slack Code of Conduct.

This is a place to ask questions, work through any development challenges, and share ideas and best practices. The following suggestions and guidelines are intended to make the community easier and more enjoyable to use.

  1. Getting Started
  2. A few details
  3. Code of Conduct