Skip to content

Instantly share code, notes, and snippets.

View robertmaynard's full-sized avatar

Robert Maynard robertmaynard

View GitHub Profile
@robertmaynard
robertmaynard / DependsTesterExample.sh
Created January 18, 2012 14:52
Example of DependsTester with ParaView
dependsTester.exe depends.exe paraview.exe -dr --server=testserver --test-directory=C:/Work/ParaView/build/Testing/Temporary --test-slave --test-baseline=C:/Work/ParaView/ParaViewData/Baseline/ZLibXDMF.png --exit
@robertmaynard
robertmaynard / DependsTester.sh
Created January 18, 2012 14:53
Calling DependsTester
dependsTester.exe depends.exe paraview.exe -dr
@robertmaynard
robertmaynard / .slate
Created November 23, 2012 18:50 — forked from trishume/.slate
My Slate config
# Configs
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config secondsBetweenRepeat 0.1
config checkDefaultsOnLoad true
config focusCheckWidthMax 3000
config keyboardLayout dvorak
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
class Parser
{
public:
template<typename Channel, typename... Args>
bool operator()(Channel& c, Args... args) const
{
}
};
//extract the first element of a parameter packs type or actual item
template <class First, class ...T>
struct first
{
typedef First type;
type operator()(First f, T...) const
{
return f;
}
//extract the last element of a parameter packs type or actual item
template<class First, class ...T>
struct last
{
typedef typename last<T...>::type type;
type operator()(First, T... t) const
{
return last<T...>::operator()(t...);
}
//trim N element off front of the arguments passed in and create a Factory type
//with those elements
template< template<class ...> class Factory, int N, class T, class ...OtherArgs>
struct ltrim
{
typedef typename ltrim<Factory,N-1,OtherArgs...>::type type;
type operator()(T t, OtherArgs... args) const
{
return ltrim<Factory,N-1,OtherArgs...>()(args...);
@robertmaynard
robertmaynard / rtrim_example
Created January 2, 2013 15:09
simple example of a fusion style rtim of a tuple.
namespace detail
{
//create a Factory item with only the first N items in it
template< template<class ...> class Factory,
int TruncateSize,
int ItemsToDrop,
class T,
class ...OtherArgs>
struct rtrim
{
@robertmaynard
robertmaynard / indicies
Created January 9, 2013 13:52
example to create a struct that holds indicies as template arguments.
//holds a sequence of integers.
template<int ...>
struct static_indices { };
//generate a struct with template args of incrementing values from Start to End
//which is inclusive at the start, exclusive at end.
//start must be less than end
template<int Start, int End, int ...S>
struct make_indices { typedef typename make_indices<Start,End-1, End-1, S...>::type type; };
# Based on @berenm's pull request https://github.com/quarnster/SublimeClang/pull/135
# Create the database with cmake with for example: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
# or you could have set(CMAKE_EXPORT_COMPILE_COMMANDS ON) in your CMakeLists.txt
# Usage within SublimeClang:
# "sublimeclang_options_script": "python ${home}/code/cmake_options_script.py ${project_path:build}/compile_commands.json",
import re
import os
import os.path