Skip to content

Instantly share code, notes, and snippets.

View Rubentxu's full-sized avatar
💭
Solo se que no se nada

Ruben Dario Rubentxu

💭
Solo se que no se nada
View GitHub Profile
@Rubentxu
Rubentxu / build.gradle
Last active August 29, 2015 14:20 — forked from mekya/build.gradle
//Export War file from Eclipse Web Project with Gradle
// we need to use war plugin
apply plugin: 'war'
//default webAppDirName in gradle is not "WebContent" but
// it is default in eclise so change it according to eclipse layout
// it encapsulates all files under webAppDirName
webAppDirName = 'WebContent'
@Rubentxu
Rubentxu / build(transitive-dependency).gradle
Last active August 29, 2015 14:27 — forked from michail-nikolaev/build.gradle
Gradle - force transitive dependency version for some group
apply plugin: 'java'
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
//specifying a fixed version for all libraries with 'org.gradle' group
if (details.requested.group == 'org.springframework') {
details.useVersion "$springVersion"
}
}
package main
import (
"fmt"
"reflect"
)
//function types
type mapf func(interface{}) interface{}
@Rubentxu
Rubentxu / maybe.go
Created September 24, 2015 23:34
Implementing the Maybe monad in Golang
package main
import (
"fmt"
"errors"
)
type Maybe interface {
Return(value interface{}) Maybe
Bind(func(interface{}) Maybe) Maybe
@Rubentxu
Rubentxu / variant.cc
Created January 17, 2016 14:32 — forked from tibordp/variant.cc
A simple variant type implementation in C++
#include <iostream>
#include <utility>
#include <typeinfo>
#include <type_traits>
#include <string>
template <size_t arg1, size_t ... others>
struct static_max;
template <size_t arg>
@Rubentxu
Rubentxu / CMakeLists.txt
Created January 25, 2016 09:12 — forked from FlorianWolters/CMakeLists.txt
Adding Boost as a Dependency with CMake
# COPYRIGHT (C) Florian Wolters 2014
#
# Author: Florian Wolters <wolters.fl@gmail.com>
cmake_minimum_required (VERSION 2.8.12.2 FATAL_ERROR)
# Set options for this project.
set (PROJECT_NAME "hello_boost_with_cmake" CXX)
project (${PROJECT_NAME})
set (PROJECT_SOURCE_DECLARATION_DIRECTORY ${PROJECT_SOURCE_DIR}/include)
@Rubentxu
Rubentxu / build.gradle
Created January 27, 2016 15:19 — forked from lyhcode/build.gradle
Gradle + Jetty + AJP (Ajp13SocketConnector)
apply plugin: 'jetty'
apply plugin: 'java'
apply plugin: 'groovy'
repositories {
mavenCentral()
}
dependencies {
providedRuntime 'org.mortbay.jetty:jetty-ajp:6.1.26'
@Rubentxu
Rubentxu / cpp-install_instructions.md
Created February 13, 2016 12:18 — forked from FlorianWolters/cpp-install_instructions.md
Installation instructions for the C++ ecosystem

Installation instructions for the C++ ecosystem

This document contains installation instructions for some C++ tools and libraries. It uses the cross-platform build system [CMake][0] whenever the software to download, build, configure (and run) supports it.

By default the process is described for a *-nix operating system (OS).

The process described here works very good, if the installed software is added to the path. It is suggested to do this, by adding the following lines to the /etc/profile.local file:

@Rubentxu
Rubentxu / repository_shared_ptr.cpp
Created March 30, 2016 08:48 — forked from Jiwan/repository_shared_ptr.cpp
C++11 example for my post - An introduction to C++'s variadic templates: a thread-safe multi-type map - using shared_ptr
#include <iostream>
#include <string>
struct DefaultSlotKey;
template <class Type, class Key = DefaultSlotKey>
class Slot
{
public:
std::shared_ptr<Type> doGet() const
@Rubentxu
Rubentxu / main.cpp
Created March 31, 2016 08:48 — forked from Jiwan/main.cpp
Final C++14 example for my post - An introduction to C++'s variadic templates: a thread-safe multi-type map
#include <iostream>
#include <memory>
#include <string>
#include "repository.hpp"
// Incomplete types used as compile-time keys.
struct Key1;
struct Key2;