Skip to content

Instantly share code, notes, and snippets.


Ivan Sanz Carasa isc30

View GitHub Profile
isc30 / triangle.cpp
Last active Sep 8, 2022 — forked from vittorioromeo/hello_triangle.cpp
SDL2 + WebGL 2.0 = Triangle
View triangle.cpp
#include <iostream>
#include <exception>
#include <functional>
#include <vector>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#ifndef __EMSCRIPTEN__
isc30 / callable.hpp
Last active Dec 28, 2021
template-based wrapper for any callable with signature + metadata traits
View callable.hpp
#pragma once
#include <type_traits>
#include <functional>
template<typename TCallable, typename TSignature>
constexpr bool is_callable_as_v = std::is_constructible<std::function<TSignature>, TCallable>::value;
typename TCallable,
isc30 / DynamicComponent.ts
Last active Jul 29, 2021
Angular Dynamic Component
View DynamicComponent.ts
import { Component, ComponentFactoryResolver, Input, OnInit, ViewContainerRef, Type, AfterViewInit, ComponentRef, ChangeDetectorRef, ViewChild, TemplateRef, Injector } from '@angular/core';
import { checkRequiredInputs, Required } from '../../decorators/required.decorator';
export interface DynamicComponentModel<T = unknown>
type: Type<T>;
inputs?: Partial<T>;
isc30 / Dockerfile
Created Mar 30, 2021
docker azure agent
View Dockerfile
FROM czon/azdo-agent:ubuntu-20.04-2.182.1
USER root
# Install the latest Docker CE binaries and add user `jenkins` to the docker group
RUN apt-get update && \
apt-get -y --no-install-recommends install apt-transport-https \
ca-certificates \
curl \
gnupg2 \
isc30 / install.bash
Last active Jan 27, 2021
Raspberry Pi Install PHP7 + Nginx + MySQL + PhpMyAdmin (last versions)
View install.bash
# Thanks to
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!)"
echo "deb stretch main contrib non-free rpi" > /etc/apt/sources.list.d/stretch.list
echo "APT::Default-Release \"jessie\";" > /etc/apt/apt.conf.d/99-default-release
isc30 / docker-compose.yml
Last active Nov 3, 2020
Jenkins Docker-Compose
View docker-compose.yml
version: '3.4'
restart: "unless-stopped"
image: 4oh4/jenkins-docker
- "jenkins_data:/var/jenkins_home"
- "/var/run/docker.sock:/var/run/docker.sock"
isc30 / SelectParallel.cs
Last active Sep 24, 2020
View SelectParallel.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Test
class Program
View conceptsV2.cpp
#include <iostream>
#include <vector>
#include <type_traits>
#include <tuple>
namespace sfinae
using success = std::true_type;
using fail = std::false_type;
View sparsevector.cpp
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class SparseVector
std::vector<bool> orderVec;
std::vector<int> valueVec;
View polymorphic_get.hpp
template<typename TBase, typename... Types>
constexpr auto polymorphic_get(std::variant<Types...>& v)
-> std::enable_if_t<(std::is_base_of_v<TBase, Types> && ...), TBase&>
return *std::visit([](auto& x){ return dynamic_cast<TBase*>(&x); }, v);