Skip to content

Instantly share code, notes, and snippets.

Vincent Tellier vtellier

Block or report user

Report or block vtellier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vtellier
vtellier / corsDummyLambda.js
Created Dec 13, 2017
A simple (and not perfect) AWS lambda function to work around the ignored `Access-Control-Allow-Origin: *` wildcard in Google Chrome.
View corsDummyLambda.js
exports.handler = (event, context, callback) => {
// Checking properties case insensitively, might be a better solution but this one works
// => https://stackoverflow.com/a/5833423/519376
Object.prototype.hasOwnPropertyCI = function(prop) {
return Object.keys(this)
.filter(function (v) {
return v.toLowerCase() === prop.toLowerCase();
}).length > 0;
};
Object.prototype.getPropertyCI = function(prop) {
@vtellier
vtellier / mi-utils.js
Created Jun 12, 2017
A Polymer 2.0 mixin that enables to factorize basic utilitary functions
View mi-utils.js
OhUtils = function(superClass) {
return class extends superClass {
constructor() {
super();
}
static get properties() {
return {
@vtellier
vtellier / Timer.h
Created Nov 30, 2016
Deterministic, re-settable, stoppable C++11 timer
View Timer.h
#pragma once
#include <exception>
#include <system_error>
#include <thread>
#include <condition_variable>
#include <mutex>
#include <functional>
#include <chrono>
#include <memory>
@vtellier
vtellier / repeat-collapse-snippet.html
Last active Mar 28, 2018
Polymer iron-collapse with dom-repeat snippet
View repeat-collapse-snippet.html
<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
<link rel="import" href="../../bower_components/iron-collapse/iron-collapse.html">
<dom-module id="your-element">
<template>
<style>
.heading {
padding: 10px 15px;
@vtellier
vtellier / LastError.h
Last active Jun 23, 2016
GetLastError() description retrieval function dependency free (except string).
View LastError.h
#pragma once
#include <string>
// Be careful, use this only for debugging.
// The function is inline and contains a lot of strings so might increase drastically the weight of your binary.
/*
// Usage exemple:
string desc;
You can’t perform that action at this time.