Skip to content

Instantly share code, notes, and snippets.

View till's full-sized avatar
💀
writing yaml

Till! till

💀
writing yaml
View GitHub Profile
diff --git a/src/Dflydev/Pimple/Provider/DoctrineOrm/DoctrineOrmServiceProvider.php b/src/Dflydev/Pimple/Provider/DoctrineOrm/DoctrineOrmServiceProvider.php
index 6d02297..59e25e1 100644
--- a/src/Dflydev/Pimple/Provider/DoctrineOrm/DoctrineOrmServiceProvider.php
+++ b/src/Dflydev/Pimple/Provider/DoctrineOrm/DoctrineOrmServiceProvider.php
@@ -211,7 +211,11 @@ class DoctrineOrmServiceProvider
$port = $cacheOptions['port'];
}
- $memcache = $app['orm.cache.factory.backing_memcache'];
+ if ($app['orm.cache.factory.backing_memcache'] instanceof \Memcache) {
@till
till / apt-spy2.md
Last active December 20, 2015 04:19

Help me test my new rubygem apt-spy2.

The goal is to easily fix broken sources on Ubuntu — in case mirrors.ubuntu.com returns a mirror which is the closest/fastest but currently broken/down/whatever.

(Requires Ubuntu!)

Need Ruby on an ancient ubuntu 10.04?

wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise_1.8.7-2012.02_amd64_ubuntu10.04.deb
@till
till / hhphpug-an-introduction-to-composer.md
Created June 9, 2013 23:04
Talks I'm gonna give in Hamburg.
  • intro composer
  • creating a composer'd library
  • defining dependencies
  • public vs private code
  • running your own repository
{
"name": "Apps",
"homepage": "http://test.example.org",
"archive": {
"directory": "dist",
"format": "tar",
"prefix-url": "s3://bucket.s3.amazonaws.com",
"skip-dev": true
},
"repositories": [
<?php
$_PUT = array();
parse_str(file_get_contents('php://input'), $_PUT);
tazz
{
"config":
maybe
true
}
// $tazz->config->maybe = true
[RuntimeException]
Failed to clone http://github.com/zendframework/Component_ZendCrypt-2.1.2.git via git, https and http protocols, aborting.
- git://github.com/zendframework/Component_ZendCrypt-2.1.2.git
fatal: remote error:
Repository not found.
- https://github.com/zendframework/Component_ZendCrypt-2.1.2.git
fatal:
@till
till / fql.sql
Created February 27, 2013 13:34
Some FQL to retrieve Facebook albums from a user which are not mobile or timeline.
SELECT size, src
FROM photo_src
WHERE photo_id IN (
SELECT object_id
FROM photo
WHERE object_id IN (
SELECT cover_object_id
FROM album
WHERE
owner = $owner
@till
till / wp-test.php
Last active December 14, 2015 01:59
<?php
// put this in your theme functions
function awin_get_alt_tag($postID, $defaultAltTag) {
$attachmentId = get_post_thumbnail_id($postID);
if (empty($attachmentId)) {
return $defaultAltTag;
}
$alt = trim(strip_tags(get_post_meta($attachmentId, '_wp_attachment_image_alt', true)));
if (!empty($alt)) {
return $alt;
@till
till / test.js
Created February 14, 2013 17:58
var memcached = require('./node_modules/php-memcached/index.js');
var db = new memcached('127.0.0.1:11211');
var r = function(e,r){
if(e)console.err(e);
console.log(r);
};
db.get('CONTENT_OF_OUR_COOKIE_HERE', function(e, r) {
process.stdout.write('Data: ');