Skip to content

Instantly share code, notes, and snippets.

Avatar
👋

Cristian Pallarés skyrpex

👋
View GitHub Profile
View not_a_monad.cpp
boost::optional<int> f1(int a);
boost::optional<int> f2(int b, int c);
boost::optional<int> f3(int d);
boost::optional<int> f4(int e);
boost::optional<int> result = chain(
[] { return f1(3); },
[] { return f1(4); }
).then(
[] (int b, int c) { return f2(b, c); }
View ApplyMacro
<apex:page standardStylesheets="false" showHeader="false" sidebar="false" recordSetVar="macros" docType="html-5.0"
standardController="Macro__c" extensions="ApplyMacroControllerExtension" title="Select Macro" >
<apex:includeScript value=""/>
<apex:includeScript value="/support/console/30.0/integration.js"/>
<apex:includeScript value="/soap/ajax/30.0/connection.js"/>
<apex:includeScript value="/support/api/30.0/interaction.js"/>
<apex:includeScript value="/canvas/sdk/js/30.0/publisher.js"/>
<apex:stylesheet value="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
@skyrpex
skyrpex / entityx_tx2.cc
Created May 17, 2016 — forked from alecthomas/entityx_tx2.cc
Parallel EntityX prototype
View entityx_tx2.cc
#include <utility>
#include <thread>
#include <limits>
#include <algorithm>
#include <cassert>
#include <vector>
#include <cstdint>
#include <iostream>
#include <mutex>
#include <future>
@skyrpex
skyrpex / .gitconfig
Created Apr 15, 2016 — forked from berngp/.gitconfig
dot.gitconfig
View .gitconfig
[user]
name = Your Name
email = your.name@mail.com
[color]
ui = true
[core]
excludesfile = ~/.gitignore_global
editor = /usr/local/bin/mvim -f
@skyrpex
skyrpex / main.cpp
Last active Oct 17, 2015
Experimental ECS C++ implementation using vectors, tuples and optionals
View main.cpp
#include <iostream>
#include <tuple>
#include <vector>
#include <experimental/optional>
template<class ...Cs>
class Container
{
public:
template<class T> using Optional = std::experimental::optional<T>;
@skyrpex
skyrpex / ioc.cpp
Last active Oct 13, 2015
Inversion Of Control in C++
View ioc.cpp
#include <iostream>
#include <typeinfo>
#include <typeindex>
#include <functional>
#include <memory>
#include <unordered_map>
class AbstractTest
{
public:
@skyrpex
skyrpex / preventDefault.babel.js
Last active Oct 6, 2015
Vue Directives: Prevent Default
View preventDefault.babel.js
const eventNames = {
BUTTON: 'click',
A: 'click',
FORM: 'submit',
};
export default {
bind() {
const eventName = eventNames[this.el.nodeName];
if (!eventName) {
View Qt 5 Dark Fusion Palette
qApp->setStyle(QStyleFactory::create("Fusion"));
QPalette darkPalette;
darkPalette.setColor(QPalette::Window, QColor(53,53,53));
darkPalette.setColor(QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Base, QColor(25,25,25));
darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53));
darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white);
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="http://static.jsbin.com/js/vendor/traceur.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<script src='http://cdn.ractivejs.org/latest/ractive.js'></script>
<meta charset="utf-8">
<title>Ractive Test</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="http://static.jsbin.com/js/vendor/traceur.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<script src='http://cdn.ractivejs.org/latest/ractive.js'></script>
<meta charset="utf-8">
<title>Ractive Test</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">