Skip to content

Instantly share code, notes, and snippets.

View DennisOSRM's full-sized avatar

Dennis Luxen DennisOSRM

View GitHub Profile
@DennisOSRM
DennisOSRM / osx.diff
Created September 6, 2012 02:52
Patchfile for compiling the luabind/0.9 on OS X
diff --git a/Jamroot b/Jamroot
index 94494bf..e0d95f7 100755
--- a/Jamroot
+++ b/Jamroot
@@ -84,7 +84,7 @@ else if [ os.name ] in LINUX MACOSX FREEBSD
local lib = $(prefix)/lib ;
local names = liblua5.1 liblua51 liblua ;
- local extensions = .a .so ;
+ local extensions = .a .so .dylib ;
@DennisOSRM
DennisOSRM / Jamroot.diff
Created September 15, 2012 17:38
Patching Jamroot script for luabind to also look for .dylib shared objects
diff --git a/Jamroot b/Jamroot
index 94494bf..e0d95f7 100755
--- a/Jamroot
+++ b/Jamroot
@@ -84,7 +84,7 @@ else if [ os.name ] in LINUX MACOSX FREEBSD
local lib = $(prefix)/lib ;
local names = liblua5.1 liblua51 liblua ;
- local extensions = .a .so ;
+ local extensions = .a .so .dylib ;
@DennisOSRM
DennisOSRM / gist:4511565
Created January 11, 2013 15:35
Packing is dependent on the order of things
#include <iostream>
#include <boost/integer.hpp>
typedef uint32_t NodeID;
struct EdgeData1 {
unsigned id:31;
bool shortcut:1;
int distance:30;
bool forward:1;
@DennisOSRM
DennisOSRM / gist:5879466
Created June 27, 2013 19:13
Load street names of the planet file
std::vector<std::string> names;
std::ifstream namesInStream(namesPath.c_str(), std::ios::binary);
if(!namesInStream) { return -1; }
unsigned size(0);
namesInStream.read((char *)&size, sizeof(unsigned));
char buf[1024];
for(unsigned i = 0; i < size; ++i) {
unsigned sizeOfString = 0;
@DennisOSRM
DennisOSRM / rebase.sh
Created February 19, 2014 15:28
Rebase current branch against origin/develop and squash all commits into a single one
#!/bin/sh
set -e
# Get the current branch name.
branch=`git rev-parse --abbrev-ref HEAD`
# Determine the commit at which the current branch diverged.
ancestor=`git merge-base develop HEAD`
# Stash any uncommited, changed files.
git stash --all
# Revert the branch back to the ancestor SHA.
--- a/boost/config/compiler/clang.hpp
+++ b/boost/config/compiler/clang.hpp
@@ -39,6 +39,11 @@
// Clang supports "long long" in all compilation modes.
#define BOOST_HAS_LONG_LONG
+#if defined(__SIZEOF_INT128__)
+# define BOOST_HAS_INT128
+#endif
+
@DennisOSRM
DennisOSRM / .bashrc
Created April 24, 2014 08:59
bashrc bit to start mergetool on conflict automatically
git()
{
if [[ $1 == "merge" ]] || [[ $1 == "rebase" ]] || [[ $1 == "pull" ]]; then
command git "$@"
rc=$?
if [[ $rc == 1 ]]; then
echo "There are conflicts, better run git-mergetool!!!"
# There might be some other condition that returns a '1',
# if so you can add another check like this:
# if grep Conflicts $(git --git-dir)/MERGE_MSG;
#!/bin/bash
time clang++ "$@"
SET PREFIX=x:\libs18d
rem Tested with unpacked archives from
rem http://zlib.net/zlib-1.2.8.tar.gz
rem http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
rem ftp://xmlsoft.org/libxml2/libxml2-sources-2.9.0.tar.gz
mkdir %PREFIX%
mkdir %PREFIX%\include
mkdir %PREFIX%\lib
@DennisOSRM
DennisOSRM / st3sc.md
Last active August 29, 2015 14:15
SublimeText3 and SublimeClang
  • Install and build SublimeClang into the packages folder of ST3
git clone --recursive https://github.com/quarnster/SublimeClang SublimeClang
cd SublimeClang/
git pull && git submodule foreach --recursive git pull origin master
cp /path/to/llvm/Release/lib/libclang.so internals/
cd src
mkdir build
cd build/