This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Attempt at making a Boost grammar that successfully parses Jason Shankel's predicate logic language | |
// #define BOOST_SPIRIT_DEBUG | |
#include <boost/spirit/include/qi.hpp> | |
#include <boost/variant/recursive_variant.hpp> | |
#include <boost/fusion/include/adapt_struct.hpp> | |
#include <boost/spirit/include/phoenix.hpp> | |
#include <boost/optional.hpp> | |
// start with the AST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import XCPlayground | |
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true | |
extension NSData { | |
func castToCPointer<T>() -> T { | |
let mem = UnsafeMutablePointer<T>.alloc(sizeof(T.Type)) | |
self.getBytes(mem, length: sizeof(T.Type)) | |
return mem.move() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
template<typename T> | |
T stuff(const T& input, typename T::value_type flag, typename T::value_type escape) { | |
if (flag == escape) | |
throw std::exception("Flag and escape are the same"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost 109.74.199.47:80> | |
ServerAdmin davy.brion@thatextramile.be | |
ServerName thatextramile.be | |
ServerAlias www.thatextramile.be | |
ProxyRequests off | |
<Proxy *> | |
Order deny,allow | |
Allow from all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node-gyp rebuild --arch=ia32 --target=0.31.0 --dist-url=https://atom.io/download/atom-shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define GET_OFFSET_FROM_INITIALIZED_STRUCT(PTR, MEMBER) [&]() -> unsigned int { return (unsigned int)&PTR.MEMBER - (unsigned int)&PTR; }() | |
#define GET_OFFSET_FROM_NON_INITIALIZED_STRUCT(STRUCT, MEMBER) []() -> unsigned int { STRUCT s; return GET_OFFSET_FROM_INITIALIZED_STRUCT(s, MEMBER); }() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var enumeration = function(initial) { | |
var _val = initial; | |
return { | |
get value() { | |
return (_val++); | |
} | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prefix operator∫ { } | |
postfix operator∫ { } | |
class Pakets | |
{ | |
enum PaketID: Int { | |
case Login | |
} | |
class ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <type_traits> | |
#include <experimental/optional> | |
template< | |
typename pred, typename ...args, | |
typename ret = std::experimental::optional<typename std::result_of<pred(args...)>::type> | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |