Skip to content

Instantly share code, notes, and snippets.

View Seldaek's full-sized avatar
😀
😀

Jordi Boggiano Seldaek

😀
😀
View GitHub Profile
@Seldaek
Seldaek / gist:9047b756ce8aebd9e369
Created March 31, 2015 17:35
php exts required on packagist
aerospike
amqp
aop
apc
apcu
bcmath
bitset
blast
blitz
bz2
@Seldaek
Seldaek / sort.js
Last active August 29, 2015 14:04
PHP Wiki Vote Chrono-sort
// 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 / keybase.md
Created March 27, 2014 13:15
Keybase.io proof

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 / gist:6711020
Last active December 23, 2015 23:39
A curious spam comment
km/h55% 0.0mm/ 0.0mm total11:21 25.5C - 15.8C 1006.7hPaNorth 3.5km/h 12.2km/h55%
0.0mm/ 0.0mm total11:26 25.5C - 15.8C 1006.7hPaSE 6.1km/h 12.2km/h55% 0.0mm/
0.0mm total11:31 25.9C - 15.6C 1006.3hPaEast 7.2km/h 8.7km/h53% 0.0mm/ 0.0mm
total11:36 26.0C - 15.7C 1006.7hPaSouth 5.0km/h 8.7km/h53% 0.0mm/ 0.0mm
total11:41 26.1C - 15.5C 1006.3hPaSSW 9.7km/h 9.7km/h52% 0.0mm/ 0.0mm total11:46
26.0C - 15.4C 1006.3hPaSW 5.0km/h 9.7km/h52% 0.0mm/ 0.0mm total11:51 26.4C -
15.8C 1006.3hPaSW 5.0km/h 9.7km/h52% 0.0mm/ 0.0mm total11:56 26.5C - 16.2C
1006.3hPaNW 8.7km/h 8.7km/h53% 0.0mm/ 0.0mm total12:01 26.1C - 15.8C
1006.3hPaSouth 11.1km/h 11.1km/h53% 0.0mm/ 0.0mm total12:06 26.3C - 16.0C
1006.3hPaNW 7.2km/h 11.1km/h53% 0.0mm/ 0.0mm total12:11 26.6C - 16.3C
@Seldaek
Seldaek / composer.json
Created February 19, 2013 15:55
security checker integration
{
// ...
"scripts": {
"post-update-cmd": [
"checker security:check composer.lock"
]
}
}
@Seldaek
Seldaek / Authenticator.php
Created November 20, 2012 11:19
Simple Symfony Auth example
<?php
namespace Acme\DemoBundle\Security;
use Symfony\Component\Security\Core\Authentication\SimpleFormAuthenticatorInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\HttpFoundation\Request;
@Seldaek
Seldaek / LoggerInterface.php
Created November 16, 2012 10:35
LoggerInterface PSR Proposal
<?php
namespace PSR\Log;
/**
* Describes a logger instance
*
* The message MUST be a string.
*
* The context array can contain arbitrary data, the only assumption that
@Seldaek
Seldaek / Comments.mdown
Created May 21, 2012 08:11
PHAR build script

This creates a $buildphar as $root/$target/foo.phar + one phar per tag as $root/$target/download/$tag/foo.phar

It also dumps the latest git commit hash built in $root/$target/version

@Seldaek
Seldaek / gitconfig
Created March 27, 2012 08:37
Git config aliases
[alias]
co = checkout
ci = commit
st = status
br = branch
rb = rebase
fu = !git fetch upstream
fo = !git fetch origin
p = push
lg = log --graph --pretty=tformat:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%an %cr)%Creset' --abbrev-commit --date=relative
@Seldaek
Seldaek / composer.json
Created March 9, 2012 08:52
Private Repo Handling
{
"repositories": [ { "type": "composer", "url": "http://composer.example.org/" } ],
"require": {
"company/package": "1.2.0",
"company/package2": "1.5.2",
"company/package3": "dev-master"
}
}