Skip to content

Instantly share code, notes, and snippets.

View jkp's full-sized avatar

Jamie Kirkpatrick jkp

View GitHub Profile
From fefdeccb336b4eb96dd5c3351ba2d5d4606bea62 Mon Sep 17 00:00:00 2001
From: Jamie Kirkpatrick <jkp@spotify.com>
Date: Sat, 25 Feb 2012 13:32:55 +0100
Subject: [PATCH] Fix compilation errors under cmake
---
Library/Formula/qt.rb | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Library/Formula/qt.rb b/Library/Formula/qt.rb
@jkp
jkp / patch
Created February 25, 2012 11:20
Patch to fix QT compilation with clang - http://bit.ly/yyg5Ch
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac_p.h b/src/gui/kernel/qt_cocoa_helpers_mac_p.h
index d831e27..fac5054 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac_p.h
+++ b/src/gui/kernel/qt_cocoa_helpers_mac_p.h
@@ -215,7 +215,7 @@ inline QString qt_mac_NSStringToQString(const NSString *nsstr)
{ return QCFString::toQString(reinterpret_cast<const CFStringRef>(nsstr)); }
inline NSString *qt_mac_QStringToNSString(const QString &qstr)
-{ return [reinterpret_cast<const NSString *>(QCFString::toCFStringRef(qstr)) autorelease]; }
+{ return [const_cast<NSString*>(reinterpret_cast<const NSString *>(QCFString::toCFStringRef(qstr))) autorelease]; }
@jkp
jkp / cmake.rb
Created February 21, 2012 09:07
Homebrew formula for cmake with Xcode 4.3 fixes
require 'formula'
class Cmake < Formula
head 'https://github.com/jkp/CMake.git', :tag => 'b8aa20c2913e91609c424d55fbb3d56cc5cd3dba'
homepage 'http://www.cmake.org/'
def install
# A framework-installed expat will be detected and mess things up.
if File.exist? "/Library/Frameworks/expat.framework"
opoo "/Library/Frameworks/expat.framework detected"
var connect = require('connect');
var http = require('http');
var phantom = require('phantom');
var websocket = require("websocket-server");
var httpServer = connect.createServer(connect.static(__dirname + "/.."));
httpServer.listen(8000);
var wsServer = websocket.createServer();
wsServer.addListener("connection", function(connection){
From 7b510532d23df7f4b3be3f205f640835bb87672a Mon Sep 17 00:00:00 2001
From: Jamie Kirkpatrick <jkp@spotify.com>
Date: Tue, 31 Jan 2012 13:00:51 +0100
Subject: [PATCH] Fixed compilation on Lion by forcing LLVM-GCC during
compilation
---
Library/Formula/lbdb.rb | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
@jkp
jkp / cmake.rb
Created January 30, 2012 09:01
Homebrew formula for my branch of Cmake with Ninja build fixes
require 'formula'
class NoExpatFramework < Requirement
def message; <<-EOS.undent
Detected /Library/Frameworks/expat.framework
This will be picked up by CMake's build system and likely cause the
build to fail, trying to link to a 32-bit version of expat.
You may need to move this file out of the way to compile CMake.
@jkp
jkp / ninjafly.sh
Created January 29, 2012 14:55
Wrapper script for ninja build that speeds up integration with flymake (http://tinyurl.com/7mstwyl)
#!/bin/bash
ninja ${@} | grep -v ^FAILED
exit ${PIPESTATUS[0]}
@jkp
jkp / gcc.rb
Created January 22, 2012 19:04 — forked from gilligan/gcc-4.6.rb
homebrew formula for gcc-4.6.0
require 'formula'
# NOTE:
#
# Two exciting enhancements in GCC 4.6.0 are currently unavailable.
#
# Link-time optimization (LTO) is broken due to changes in XCode 3.2.6 and 4.0.
# This should be fixed in GCC 4.6.1:
# http://lists.macosforge.org/pipermail/macports-dev/2011-March/014278.html
#
@jkp
jkp / wsgi_async.py
Created November 22, 2009 13:54
Experimental code to add async functionality to WSGI applications running under Tornado
#!/usr/bin/env python
#
# Jamie Kirkpatrick, November 2009. <jkp@kirkconsulting.co.uk>
# Released under the BSD license.
#
"""
Experimental code to add asyncronous functionality to WSGI applications
running under the Tornado webserver. Uses greenlet to spin micro-threads
which can be suspended and resumed within a single thread as required.