Skip to content

Instantly share code, notes, and snippets.

View eulersson's full-sized avatar

Ramon Blanquer eulersson

  • Barcelona
View GitHub Profile
@eulersson
eulersson / ButterflyPillow.cpp
Last active February 27, 2017 13:56
Parametric Butterfly Pillow
class ParametricButterflyPillow
{
public:
explicit ParametricButterflyPillow(const double radius) {}
GVector3 evaluate(const double u, const double v) const
{
const double theta = 2.0 * Pi * u;
const double phi = Pi * v;
return GVector3(
@eulersson
eulersson / drag_and_drop_labels.py
Last active February 27, 2017 15:00
Drag & Drop Labels
import sys
import uuid
from PySide import QtCore, QtGui
COLOR_MAP = {
'WIP': '#994',
'Unassigned': '#944',
'Assigned': '#494',
}
@eulersson
eulersson / main.cpp
Last active November 24, 2020 02:38
Thrust + CUDA kernel
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <thrust/device_vector.h>
/*
* --- Using Thrust vectors in kernel functions ---
* This example demonstrates how we can use device vectors (vectors that live
* in GPU) as arguments to a kernel launched by the CPU.
@eulersson
eulersson / installprefix.sh
Last active February 27, 2017 14:57
Changing install destination of compiled libraries
# /////////////////////////////////////////
# Choosing where library will be installed:
# /////////////////////////////////////////
# Option 1:
./configure --prefix=/path/where/to/install
# Options 2:
cmake -DCMAKE_INSTALL_PATH=/path/where/to/install .
# Option 3:
export DESTDIR=/path/where/to/install && make install
@eulersson
eulersson / .vimrc
Last active February 27, 2017 14:59
Vim profile
set ts=2 tabstop=2 shiftwidth=2 expandtab autoindent
autocmd FileType python nnoremap <buffer> <F9> :exec '!python' shellescape(@%, 1)<cr>
autocmd FileType javascript nnoremap <buffer> <F9> :exec '!node' shellescape(@%, 1)<cr>
@eulersson
eulersson / sshtunnel.sh
Last active April 4, 2017 12:09
SSH Tunel
# ///////////////////////////////////////
# SSH Tunneling
# How it looks like:
# [UNI]<-->[CLOUD (relay)]<-->[CLIENT]
# UNI: localhost (127.0.0.1)
# CLOUD: posvec.xyz (46.101.1.33)
# CLIENT: any IP you have or connect from
# ///////////////////////////////////////
# Steps:
@eulersson
eulersson / metaballs.glsl
Last active February 27, 2017 15:01
Metaballs (Synthclipse)
uniform vec3 iResolution; // viewport resolution (in pixels)
uniform float iGlobalTime; // shader playback time (in seconds)
uniform float iChannelTime[4]; // channel playback time (in seconds)
uniform vec3 iChannelResolution[4]; // channel resolution (in pixels)
uniform vec4 iMouse; // mouse pixel coords. xy: current (if MLB down), zw: click
uniform vec4 iDate; // (year, month, day, time in seconds)
uniform bool WithGamma; //! checkbox[true]
uniform float Gamma; //! slider[0.1, 2.2, 10]
uniform float tete; //! slider[0.0, 0.1, 0.2]
@eulersson
eulersson / rpi_android_display.sh
Last active April 23, 2017 21:59
Using Android as RPi display
# =============================================================================
# ANDROID AS DISPLAY SCREEN FOR RASPBERRY PI
# =============================================================================
# Sets VNC so you can use your Android phone as display for Raspberry Pi. If
# you plug it via USB and use USB Tethering and install the required things
# (following steps in this file) it should work.
#
# Following this resources:
# https://www.raspberrypi.org/forums/viewtopic.php?f=41&t=127971
# http://rageweb.info/2013/11/07/bootconfig-txt-in-kali/
@eulersson
eulersson / ecsfs_parameters.yaml
Created February 19, 2019 23:54
Parameters, conditions resources and outputs.
Parameters:
HostedZoneName:
Type: String
Description:
(Optional) If you have a domain available registered with Route 53 you
can type it (e.g. 'foo.com.'; do not miss the final dot!). Then a DNS
record gets created on subdomain ecsfs.foo.com which will route to the
load balancer (the entry point of this application).
Conditions:
HasHostedZoneName: !Not [ !Equals [ !Ref HostedZoneName, '']]