Skip to content

Instantly share code, notes, and snippets.

View jbergstroem's full-sized avatar

Johan Bergström jbergstroem

View GitHub Profile
@jbergstroem
jbergstroem / foo.diff
Created October 17, 2012 03:45
proper hex version information in libmemcached headers
=== modified file 'libmemcached-1.0/configure.h.in'
--- libmemcached-1.0/configure.h.in 2011-10-02 18:02:19 +0000
+++ libmemcached-1.0/configure.h.in 2012-10-17 03:34:45 +0000
@@ -45,7 +45,7 @@
@LIBMEMCACHED_WITH_SASL_SUPPORT@
#define LIBMEMCACHED_VERSION_STRING "@VERSION@"
-#define LIBMEMCACHED_VERSION_HEX @PANDORA_HEX_VERSION@
+#define LIBMEMCACHED_VERSION_HEX @HEX_VERSION@
@jbergstroem
jbergstroem / gunicorn-0.16.1.ebuild
Created November 27, 2012 03:07
Gunicorn 0.16.1 version bump: Add USE=doc and remove self-referencing test
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="2.5 3.1 *-jython"
DISTUTILS_SRC_TEST="nosetests"
inherit distutils eutils
@jbergstroem
jbergstroem / bitset-2.8.1.ebuild
Created December 3, 2012 21:53
Initial ebuild for bitset
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
DESCRIPTION="A compressed bitset with supporting data structures and algorithms"
HOMEPAGE="http://github.com/chriso/bitset"
SRC_URI="https://github.com/downloads/chriso/${PN}/${P}.tar.gz"
@jbergstroem
jbergstroem / pgbouncer.diff
Created January 16, 2013 07:08
pgbouncer-1.5.3 diff
--- pgbouncer-1.5.3-r1.ebuild 2013-01-15 04:29:29.000000000 +1100
+++ /usr/local/portage/dev-db/pgbouncer/pgbouncer-1.5.3.ebuild 2013-01-03 13:37:38.164148255 +1100
@@ -1,6 +1,6 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/pgbouncer-1.5.3-r1.ebuild,v 1.1 2013/01/14 17:29:29 pinkbyte Exp $
+# $Header: $
EAPI="4"
@jbergstroem
jbergstroem / node-force-bundled-v8.patch
Last active December 14, 2015 04:28
gentoo: switch from shared v8 to in-tree v8 until we've sorted a proper v8 dependency.
--- /usr/portage/net-libs/nodejs/nodejs-0.8.18.ebuild 2013-01-21 14:58:37.000000000 +1100
+++ nodejs-0.8.20.ebuild 2013-02-25 17:14:14.960423967 +1100
@@ -20,8 +20,7 @@
KEYWORDS="~amd64 ~arm ~x86 ~x64-macos"
IUSE=""
-DEPEND=">=dev-lang/v8-3.11.10:=
- dev-libs/openssl"
+DEPEND="dev-libs/openssl"
RDEPEND="${DEPEND}"
@jbergstroem
jbergstroem / node-0.9.11.ebuild
Last active December 14, 2015 13:59
node 0.9.11.ebuild - in preparation for next stable in gentoo
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
PYTHON_COMPAT=( python2_5 python2_6 python2_7 )
inherit python-any-r1 pax-utils
@jbergstroem
jbergstroem / nginx-add-echo.diff
Created May 26, 2013 00:28
Adds echo module to the gentoo 1.4.1 ebuild
--- /usr/portage/www-servers/nginx/nginx-1.4.1-r5.ebuild 2013-05-24 06:32:59.000000000 +1000
+++ nginx-1.4.1-r6.ebuild 2013-05-26 10:15:52.759716020 +1000
@@ -108,6 +108,12 @@
HTTP_DAV_EXT_MODULE_URI="http://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
+# echo-nginx-module (https://github.com/agentzh/echo-nginx-module, BSD license)
+HTTP_ECHO_NGINX_MODULE_PV="0.45"
+HTTP_ECHO_NGINX_MODULE_P="echo_nginx_module-${HTTP_ECHO_NGINX_MODULE_PV}"
+HTTP_ECHO_NGINX_MODULE_URI="https://github.com/agentzh/echo-nginx-module/archive/v${HTTP_ECHO_NGINX_MODULE_PV}.tar.gz"
@jbergstroem
jbergstroem / redirect.conf
Created May 26, 2013 00:39
redirect www.* to non-www domains in nginx
server {
listen foo:80;
server_name ~^www\.(?<domain>.+)$;
error_log /var/log/nginx/error.log crit;
rewrite ^(.*) http://$domain$1 permanent;
}
@jbergstroem
jbergstroem / gist:5654457
Created May 26, 2013 23:38
list of currently co-maintained packages
# grep bergstroem */*/metadata.xml | cut -d '/' -f 1,2
app-admin/collectd
app-misc/beanstalkd
app-text/xapian-omega
dev-db/kyotocabinet
dev-db/libzdb
dev-db/mongodb
dev-db/pgbouncer
dev-db/pgmemcache
dev-db/redis
@jbergstroem
jbergstroem / wp-bug-20534.diff
Created October 30, 2013 03:17
Fix for wordpress bug #20534
diff --git a/wp-includes/media.php b/wp-includes/media.php
index 1497238..9ca3ad7 100644
--- a/wp-includes/media.php
+++ b/wp-includes/media.php
@@ -174,6 +174,7 @@ function image_downsize($id, $size = 'medium') {
// we have the actual image size, but might need to further constrain it if content_width is narrower
list( $width, $height ) = image_constrain_size_for_editor( $width, $height, $size );
+ $img_url = ( is_admin() ? set_url_scheme( $img_url , 'admin' ) : set_url_scheme( $img_url ) );
return array( $img_url, $width, $height, $is_intermediate );