Skip to content

Instantly share code, notes, and snippets.

@Crash--
Crash-- / inteach_cards.js
Created December 11, 2017 11:55
InTeach test card with cypress
describe('InTeach cards', function() {
it('properly ends a lesson going throw all the cards', function() {
//We can certainly use Cypress Fixture system to do that.
const local = {
url: 'http://localhost:5000',
email: 'taaaa@inteach.io',
password: 'XXXX',
course_title: 'Cours de test n°1',
lesson_title: 'Leçon avec tous les types de carte',
};
@Crash--
Crash-- / config.yml
Created December 3, 2017 16:21
Config CI for Cypress et ReactJS
version: 2
jobs:
build:
docker:
# the Docker image with Cypress dependencies
- image: cypress/base:8
environment:
## this enables colors in the output
TERM: xterm
{{embed base}}
{{range fonts}}
{{range .}}
@font-face {
font-family: iBooks_{{.$parent.$key}};
src: local('{{.}}');
font-weight: {{.$key}};
}
{{end range .}}
body { font-size: 18px; line-height: 1.5; }
@page { margin: 0px; padding: 0px; } .gb-segment { margin: 0px; padding: 0px; } .gb-segment div { text-align: center; width: auto; height: 99%; margin: 0px; color: blue; } .gb-segment img { max-width: 100%; height: 100%; }
html, body, .gb-segment { border: 0px !important; margin: 0px !important; padding: 0px !important; } .gb-page { position: absolute; } .gb-page-container { position: absolute; overflow: hidden; } body.sepia-mode { background-color: rgb(236, 225, 202) !important; color: rgb(100, 80, 50) !important; } body.sepia-mode * { background-color: transparent !important; color: rgb(100, 80, 50) !important; } body.sepia-mode a:link { color: -webkit-link !important; } body.night-mode { background-color: rgb(0, 0, 0) !important; color: rgb(204, 204, 204) !important; } body.night-mode * { background-color: transparent !important; color: rgb(204, 204, 204) !important; } body.night-mode a:link, body.footnote-night-mode a:link { color: rgb(3, 155, 229) !important; }
@Crash--
Crash-- / catalogue netflixfr
Created September 15, 2014 08:52
Catalogue de netflix FR
Cinéma français
Delicatessen
Sheitan
Romance
Enter the Void
L'Appolonide, souvenirs de la maison close
Indochine
Ils
Swimming Pool
<?php
public function streamAction(){
$toto = $this->xml_stream_reader('./data/hg3.xml');
var_dump($toto);
return false;
}
public function xml_stream_reader($url)
{
@Crash--
Crash-- / gist:750d6e5c0e029ca71dc8
Created May 22, 2014 22:24
Firebase : Here we go!
var firebase = new Firebase('https://v****.firebaseio.com/exercices');
firebase.on('child_added', function(newExercice) {
$scope.$apply(function(){
updateExercices($scope.exercices, $scope.chartData, newExercice);
});
});
#!/bin/bash
for f in `find ./app/app/data -name "index.html"`;do
png=${f/html/png}
phantomjs ./bin/rasterize.js $f $png "entire page"
metadataFile=${f/index/meta-data}
metadataFile=${metadataFile/html/json}
IMG_CHARS=$(identify "${png}" 2> /dev/null) || die "${IMAGE} is not a proper image"
# grab width and height
self = [super initPageWithID:_bookPageIdentifier.ID
book:_bookPageIdentifier.book
title:_bookPageIdentifier.title
titleHtml:_bookPageIdentifier.titleHtml
path:_bookPageIdentifier.path
thumbnail:_bookPageIdentifier.thumbnail
pagePrefix:_bookPageIdentifier.pagePrefix
pageShortPrefix:_bookPageIdentifier.pageShortPrefix
pageLongPrefix:_bookPageIdentifier.pageLongPrefix
parentPart:_bookPageIdentifier.parentPart
@Crash--
Crash-- / gist:9526238
Last active August 29, 2015 13:57
Some HTML from epub 3 fixed-layout
<span class="s1 f49 fs7 l0" style=
"left:35909.7px;bottom:1711.58px;letter-spacing:-20px;word-spacing:20px;color:rgb(35,31,32);">
19</span><span class="s1 f53 fs8 l0" style=
"left:31691.7px;bottom:1702.37px;letter-spacing:-3px;word-spacing:20px;color:rgb(35,31,32);">P</span><span class="s1 f53 fs8 l0"
style=
"left:32025.8px;bottom:1702.37px;letter-spacing:-3px;word-spacing:20px;color:rgb(35,31,32);">e</span><span class="s1 f53 fs8 l0"
style=
"left:32312.6px;bottom:1702.37px;letter-spacing:-3px;word-spacing:20px;color:rgb(35,31,32);">o</span><span class="s1 f53 fs8 l0"
style=
"left:32625.4px;bottom:1702.37px;letter-spacing:-3px;word-spacing:20px;color:rgb(35,31,32);">p</span><span class="s1 f53 fs8 l0"