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 / keybase.md
Created Mar 27, 2014
Keybase.io proof
View keybase.md

Keybase proof

I hereby claim:

  • I am seldaek on github.
  • I am seldaek (https://keybase.io/seldaek) on keybase.
  • I have a public key whose fingerprint is 245D B3BE FBFE F1E7 8689 8686 D7F1 1ADC 1848 487E

To claim this, I am signing this object:

@Seldaek
Seldaek / sort.js
Last active Aug 29, 2015
PHP Wiki Vote Chrono-sort
View sort.js
// Run this in web console
var rows = $('table tr').get();
rows.sort(function(a, b) {
var keyA = $(a).find('img[src="/lib/images/success.png"]').attr('title') || '0';
var keyB = $(b).find('img[src="/lib/images/success.png"]').attr('title') || '0';
if (keyA < keyB) return -1; if (keyA > keyB) return 1; return 0;
});
$.each(rows, function(index, row) {$('table tbody').append(row);});
@Seldaek
Seldaek / gist:9047b756ce8aebd9e369
Created Mar 31, 2015
php exts required on packagist
View gist:9047b756ce8aebd9e369
aerospike
amqp
aop
apc
apcu
bcmath
bitset
blast
blitz
bz2
View packagist update hook
curl -XPOST -v https://packagist.org/api/github --data 'payload={"repository":{"url":"https://github.com/FOO/BAR"}}&apiToken=TOKEN&username=USERNAME'
View Of redirects
// format: html, POST /register, dev calls setRedirectRoute('welcome')
302 => /welcome, browser redirects, gets a new page
// format: json, POST /register, dev calls setRedirectRoute('welcome')
302 => /welcome, browser redirects, /welcome returns a 200 with {"some json shit"}, ajax callback gets json
// format: html, GET|POST /anypage, dev calls setRedirectUri('http://google.com/FUUUUU')
View FooController.php
class FooController
{
public function viewArticleAction($articleId)
{
$article = $this->articleRepository->getById($articleId);
$parameters = array(
'article' => $article,
);
// beginner
View config_dev.yml
imports:
- file:config.yml
- file:somestuff.yml
services:
foo.controller:
class: Application\FooBundle\Controller\FooController
arguments:
- @router
- @request
View results
<?php
class Field {
protected static $options = array('a', 'b');
public static function getOptions() {
return static::$options;
}
public static $options2 = array('a', 'b');
}
View res
float 3.8314838409424
float 2.6161198616028
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
You can’t perform that action at this time.