Skip to content

Instantly share code, notes, and snippets.

@qgp9
qgp9 / pythonic_range.cxx
Created September 19, 2016 23:06
pythonic range in C++11x
#include <iostream>
#include <vector>
#include <algorithm>
class Ranger {
public:
typedef int value_type;
struct iterator {
iterator(size_t counter) : counter(counter) {}
iterator operator++(){ return iterator(++counter); }
bool operator!=(iterator o) { return counter != o.counter; }
@qgp9
qgp9 / SafeFormatter.h
Last active September 29, 2016 16:30
#include <string>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <stdlib.h>
class SafeFormatter{
public:
SafeFormatter( const char * s ):fForm(s),fIterator(fForm.begin()){}
void compile(){return ;}
template< typename T, typename ... A >

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@johannes-z
johannes-z / customDirectives.js
Last active September 8, 2017 13:17
[WIP] Vue directive to generate HTML from a (scoped) slot and values.
import Vue from 'vue'
/**
* Usage:
* <span v-slot:one="{ slots, value: 'component B2' }"></span>
* v-slot:<SLOT_NAME>="{ slots, <VALUE> }"
*
* Pass the slots like this:
* <my-component :slots="$scopedSlots" />
* inside MyComponent define props: ['slots']