Skip to content

Instantly share code, notes, and snippets.

View Swiip's full-sized avatar

Matthieu Lux Swiip

View GitHub Profile
const BB8 = styled.div`
&:before,
&:after {
display: block;
content: "";
position: absolute;
}
`;
const BigBB8 = BB8.extend`
zoom: 200%;
`;
const BB8 = styled.div`
animation: ${({ turn }) => turn ?
`${spin} 0.8s infinite linear` : "none"};
/* or */
${({ turn }) => turn && css`
animation: ${spin} 0.8s infinite linear;
`}
`;
const white = alpha => `rgba(255, 255, 255, ${alpha})`;
const BB8 = styled.div`
background-image:
radial-gradient(circle at 58px 32px, ${white(0.9)} 2px, transparent 3px)
`;
import styled from "styled-components";
const Container = styled.div`
display: flex;
align-items: center;
justify-content: center;
height: calc(100vh - 2 * 8px);
`;
@Swiip
Swiip / chrome debug log
Last active March 22, 2018 08:01
Basic Node HTTP/2 Push Server
628408: HTTP2_SESSION
localhost:8443 (DIRECT)
Start Time: 2018-03-22 09:00:43.870
t=1298705 [st=0] +HTTP2_SESSION [dt=?]
--> host = "localhost:8443"
--> proxy = "DIRECT"
t=1298705 [st=0] HTTP2_SESSION_INITIALIZED
--> protocol = "h2"
--> source_dependency = 628407 (SOCKET)
@Swiip
Swiip / angular1.html
Last active October 23, 2016 08:05
Meet Fountain
<div class="main-container">
<fountain-header></fountain-header>
<main class="main">
<fountain-title></fountain-title>
<fountain-techs></fountain-techs>
</main>
<fountain-footer></fountain-footer>
</div>
@Swiip
Swiip / karma.conf.js
Created October 19, 2016 09:46
"Testing an AngularJS app with Jest" karma code sample
module.exports = function (config) {
config.set({
basePath: '../',
singleRun: true,
autoWatch: false,
files: [
'node_modules/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.js',
'src/app/mock/utils.js',
'src/index.spec.js'
@Swiip
Swiip / jest.init.js
Last active June 2, 2020 11:52
"Testing an AngularJS app with Jest" jest code samples
var localStorageMock = /* ... some mock code ... */
Object.defineProperty(window, 'localStorage', {
value: localStorageMock
});
import './app/index.module';
import 'angular-mocks';
import './app/mock/utils';
@Swiip
Swiip / home.component.spec.ts
Created July 5, 2016 08:07
Test HomeComponent
/* tslint:disable:no-unused-variable */
// import { By } from '@angular/platform-browser';
// import { DebugElement } from '@angular/core';
import { async, inject } from '@angular/core/testing';
import { TestComponentBuilder, ComponentFixture } from '@angular/compiler/testing';
import { HomeComponent } from './home.component';