Skip to content

Instantly share code, notes, and snippets.

@vinipsmaker
vinipsmaker / routes.json
Last active December 11, 2015 21:49
A draft of the new Tufão's plugin system file format.
{
"version": 0,
"plugins": [
{
"name": "home",
"path": "/home/vinipsmaker/Projetos/tufao-project42/build/plugins/libhome.so",
"customData": {"appName": "Hello World", "root": "/"}
},
{
"name": "user",
@vinipsmaker
vinipsmaker / musical.qml
Created February 9, 2013 23:36
Simple program to help me practice violin
import QtQuick 1.1
Rectangle {
width: 360; height: 360
Text {
id: pitch
anchors.centerIn: parent
width: parent.width; height: parent.height
@vinipsmaker
vinipsmaker / qt5 http server.cpp
Created March 3, 2013 16:20
I love C++11 lambdas
#include <QCoreApplication>
#include <Tufao/HttpServer>
#include <Tufao/HttpServerRequest>
using namespace Tufao;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
HttpServer server;
# Maintainer: Erik van der Kolk <developer at smerik dot nl>
pkgname=editorconfig-core
pkgver=0.11.4
pkgrel=1
pkgdesc="EditorConfig core code written in C (for use by plugins supporting EditorConfig parsing)"
arch=('i686' 'x86_64')
url="https://github.com/editorconfig/${pkgname}"
license=('BSD')
depends=('glibc')
makedepends=('cmake')
if ( A.connected(B) ) {
if ( !C.connected(D) ) {
bool foreign_is_contour = edge(C, D).contour();
// the number of contour edges
switch ( edge(A, C).contour()
+ edge(B, D).contour()
+ foreign_is_contour ) {
case 2:
A.smooth = !foreign_is_contour;
00:38:31,440 --> 00:38:36,321
They flood the house
by breaking through a water main.
359
00:38:37,440 --> 00:38:40,523
<i>I can do anything I want.</i>
360
00:38:41,680 --> 00:38:43,569
#include <iostream>
#include <memory>
namespace dyn
{
namespace impl
{
template<class T>
struct mutator
{
A; //< cell A
// current iterated node (the one in the middle of the image) smoothness
A.smooth;
// It's a cyan node!
assert(!A.connected(D));
assert(!B.connected(C));
if ( A.connected(B) ) {
>>> a = [1, 2, 3] # Inicializa a com uma lista
>>> a[0] # Acessa o primeiro elemento de a
1
>>> a[0:3] # Acessa o intervalo [0;3)
[1, 2, 3]
>>> a[:] # Os argumentos padrões são 0 e o tamanho do intervalo
[1, 2, 3]
>>> a[1:] # Outro exemplo de argumentos padrões
[2, 3]
>>> a[:-1] # Intervalo do primeiro elemento até o penúltimo (-1 exclui um elemento do final)
class l(object):
def __init__(self, p1, p2):
self.p1 = p1
self.p2 = p2
def __call__(self, t):
ret = list(self.p1)
for i in range(len(ret)):
ret[i] = (1 - t) * self.p1[i] + t * self.p2[i]
return tuple(ret)