Skip to content

Instantly share code, notes, and snippets.

struct Dog {};
struct Husky : public Dog {};
struct Poodle :public Dog {};
template<class T>
struct is_husky {
static constexpr bool result = false;
};
template<>
template <bool, typename T = void>
struct stop_if{
typedef T type;
};
template <typename T>
struct stop_if<true, T> {};
struct Dog {};
struct Husky : public Dog {};
struct Dog {};
struct Husky: public Dog {};
struct Poodle:public Dog {};
template<class T>
void DogCanBeSmartExceptHusky(const T&& dog) {};
int main()
{
DogCanBeSmartExceptHusky( Poodle{} );
@charlesxsh
charlesxsh / docker-compose.yml
Created July 12, 2018 22:04
Example of dockerize your developing environment
version: '2'
services:
db:
image: postgres
ports:
- 5432:5432
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
# You definitly need some tools to visualize/edit/debug your database right?
@charlesxsh
charlesxsh / CustomReactNavigationTabbar.tsx
Last active June 22, 2020 01:40
Customize tab bar in react native using react navigation
import React from 'react';
import { Component } from 'react';
import {
TouchableOpacity,
Text,
View,
Image
} from 'react-native';
import { TabBarBottomProps, NavigationRoute } from 'react-navigation';