Skip to content

Instantly share code, notes, and snippets.

View Seldaek's full-sized avatar
😀
😀

Jordi Boggiano Seldaek

😀
😀
View GitHub Profile
@Seldaek
Seldaek / RSSFeedGen.php
Created February 17, 2012 17:38
Old RSS Feed "lib"
<?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 February 17, 2012 16:22
standard-distro temp
{
"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 February 13, 2012 18:15
Deployment script
#!/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 February 3, 2012 13:37
SHA1 + HMAC in 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 January 13, 2012 09:40
Patch for Sublime Text 2 "highlight_modified_tabs" (missing in b2165)
/* 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
},

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 13:48
Mailer service mocking for Symfony2
<?php
namespace Nelmio\HomeBundle\Tests\Controller;
use Nelmio\HomeBundle\Controller\ContactController;
use Liip\FunctionalTestBundle\Test\WebTestCase;
class ContactControllerTest extends WebTestCase
{
public function testEmail()
# /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
@Seldaek
Seldaek / res
Created December 16, 2010 14:13
float 3.8314838409424
float 2.6161198616028
@Seldaek
Seldaek / results
Created December 15, 2010 17:20
forms
<?php
class Field {
protected static $options = array('a', 'b');
public static function getOptions() {
return static::$options;
}
public static $options2 = array('a', 'b');
}