Skip to content

Instantly share code, notes, and snippets.

View eswak's full-sized avatar
🚀

Erwan Beauvois eswak

🚀
  • Toulouse, France
View GitHub Profile
@eswak
eswak / automatic-grid.html
Created July 17, 2014 08:24
Automatic grid in CSS3
<html>
<head>
<style>
.grid *:first-child:nth-last-child(1) {
width: 100%;
}
.grid *:first-child:nth-last-child(2),
.grid *:first-child:nth-last-child(2) ~ * {
width: 50%;
@eswak
eswak / after&tooltips.html
Last active August 29, 2015 14:02
CSS ::after styles & pure css tooltips
<head>
<style>
section {
padding:2em 1.5em 1.5em 1.5em;
font-size:2em;
background:yellow;
font-family:sans;
position:relative;
overflow:hidden;
}
@eswak
eswak / express.host.js
Created June 17, 2014 11:53
Easy & simple express static host
var express = require('express');
var app = express();
app.use('/totem', express.static(__dirname + '/totem'));
app.use('/remote', express.static(__dirname + '/remote'));
app.use('/minisite', express.static(__dirname + '/minisite'));
ap.get('/', function(req, res) {
res.send('<a href="/minisite">minisite</a><br>');
res.send('<a href="/remote">remote</a><br>');
@eswak
eswak / mochachaisinon.js
Last active April 16, 2019 14:21
An example of asynchronous JavaScript testing using Mocha + Chai + Sinon
var chai = require('chai');
var assert = chai.assert;
var expect = chai.expect;
var should = chai.should();
var sinon = require('sinon');
function myAsyncFunction(callback) {
// 50ms delay before callback
setTimeout(function() {
console.log('hello');