Skip to content

Instantly share code, notes, and snippets.

😀
😀

Jordi Boggiano Seldaek

😀
😀
Block or report user

Report or block Seldaek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Seldaek
Seldaek / RSSFeedGen.php
Created Feb 17, 2012
Old RSS Feed "lib"
View RSSFeedGen.php
<?php
namespace Seld\RSSBundle;
/**
* RSS feed (RSS 2.0) generator
*
* all the mandatory fields are set in the constructor, the rest is
* accessible either through public properties or public methods.
*
@Seldaek
Seldaek / composer.json
Created Feb 17, 2012
standard-distro temp
View composer.json
{
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.2",
"symfony/symfony": "2.1.0-dev",
"doctrine/orm": "2.2.0",
"doctrine/doctrine-bundle": "master-dev",
"twig/extensions": "master-dev",
@Seldaek
Seldaek / deploy.sh
Created Feb 13, 2012
Deployment script
View deploy.sh
#!/bin/sh
targetUser="seld"
targetHost="seld.be"
parentDir="/home/seld"
childDir="packagist.org"
port="22"
configFile="~/etc/conf/$childDir.yml"
@Seldaek
Seldaek / sha1hmac.js
Created Feb 3, 2012
SHA1 + HMAC in JS
View sha1hmac.js
var Crypto = {};
Crypto.sha1_hmac = function (msg, key) {
"use strict";
var oKeyPad, iKeyPad, iPadRes, bytes, i, len;
if (key.length > 64) {
// keys longer than blocksize are shortened
key = Crypto.sha1(key, true);
}
@Seldaek
Seldaek / Default.sublime-theme
Created Jan 13, 2012
Patch for Sublime Text 2 "highlight_modified_tabs" (missing in b2165)
View Default.sublime-theme
/* Path: Packages/Theme - Default/Default.sublime-theme, add add the end before the ']' */
/* Patch for highlight_modified_tabs */
,{
"class": "tab_control", "attributes": ["dirty"],
"tint_modifier": [255, 255, 0, 230],
"layer0.texture": "Theme - Default/dark_tab_mask3.png",
"layer2.texture": "Theme - Default/dark_unselected_tab_bg2.png",
"layer2.opacity": 1.0
},
View Annot_RFC.mdown

Annotation Change RFC

Most of those changes are ideas taken from the php-annotations lib (see its wiki too) by Rasmus Schultz.

Goals

I am not the author of that lib but have been discussing with him for a while and I am convinced that this could benefit Symfony users and PHP as a whole on the long run, if we standardized the annotations a bit more than what we have right now.

@Seldaek
Seldaek / ContactControllerTest.php
Created May 25, 2011
Mailer service mocking for Symfony2
View ContactControllerTest.php
<?php
namespace Nelmio\HomeBundle\Tests\Controller;
use Nelmio\HomeBundle\Controller\ContactController;
use Liip\FunctionalTestBundle\Test\WebTestCase;
class ContactControllerTest extends WebTestCase
{
public function testEmail()
View gist:874689
# /usr/bin/grep -rh '<service id=' --include='*.xml' src/Symfony/ | sed -re 's/ *<service id="([^"]+)".+/\1/g'
assetic.filter_manager
assetic.asset_manager
assetic.asset_factory
assetic.filter.cssrewrite
assetic.filter.less
assetic.filter.sass
assetic.filter.scss
assetic.filter.google_closure_compiler
View res
float 3.8314838409424
float 2.6161198616028
View results
<?php
class Field {
protected static $options = array('a', 'b');
public static function getOptions() {
return static::$options;
}
public static $options2 = array('a', 'b');
}
You can’t perform that action at this time.