Skip to content

Instantly share code, notes, and snippets.

View moleike's full-sized avatar
🌟
dare to think for yourself

Alexandre Moreno moleike

🌟
dare to think for yourself
  • Barcelona
  • 08:49 (UTC +02:00)
  • X @moleike
View GitHub Profile
@moleike
moleike / NavigationDrawer.qml
Last active August 29, 2015 14:27 — forked from jbache/NavigationDrawer.qml
Qt Quick Navigation Drawer
/*
Copyright (c) 2014 Cutehacks A/S
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import gtk
import webkit
def entry_activated_cb(entry, embed):
embed.load_uri(entry.get_text())
# Widgets and signals
// credit to http://stackoverflow.com/a/14665230/339222
#include <functional>
#include <chrono>
#include <future>
#include <iostream>
class later
{
public:
@moleike
moleike / heap-lambda.cc
Last active August 29, 2015 14:22
Lambda in a C callback
#include <functional>
#include <iostream>
// using a lambda in a C callback
extern "C" void
register_callback (void (*callback)(void *), void * context)
{
// for simplicity we just call it
callback (context);
@moleike
moleike / rethrow.cc
Last active August 29, 2015 14:16
Convert a C++ exception into a Java exception
void rethrow_cpp_exception_as_java_exception()
{
try
{
throw;
}
catch (const package::Exception& e)
{
jclass jc = env->FindClass("group/package/Exception");
if(jc) env->ThrowNew (jc, e.what());
/*
* V4L2 video capture example
*
* This program can be used and distributed without restrictions.
*
* This program is provided with the V4L2 API
* see http://linuxtv.org/docs.php for more information
*/
#include <stdio.h>