Skip to content

Instantly share code, notes, and snippets.

View Swiip's full-sized avatar

Matthieu Lux Swiip

View GitHub Profile
@Swiip
Swiip / index.js
Created December 23, 2014 13:39
Prototype of Mardown template engine
/* jshint evil:true */
var fs = require('fs');
var _ = require('lodash');
var marked = require('marked');
var renderer = new marked.Renderer();
var model = fs.readFileSync('model.md').toString();
➜ gulp-angular gulp test
[12:27:08] Using gulpfile ~/Workspace/Sandbox/gulp-angular/gulpfile.js
[12:27:08] Starting 'tsd:init'...
[12:27:08] Finished 'tsd:init' after 8.21 ms
[12:27:08] Starting 'tsd:install'...
[12:27:11] Definition file written: angularjs/angular-animate.d.ts
[12:27:11] Definition file written: jquery/jquery.d.ts
[12:27:11] Definition file written: angularjs/angular-resource.d.ts
[12:27:11] Definition file written: angularjs/angular-route.d.ts
[12:27:11] Definition file written: angularjs/angular.d.ts
'use strict';
module.exports = function(config) {
config.set({
logLevel: config.LOG_INFO,
frameworks: ['jasmine'],
browsers : ['PhantomJS'],
@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';
@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 / 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 / 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 / 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)
import styled from "styled-components";
const Container = styled.div`
display: flex;
align-items: center;
justify-content: center;
height: calc(100vh - 2 * 8px);
`;
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)
`;