Skip to content

Instantly share code, notes, and snippets.

View davidtorroija's full-sized avatar
🏠
Working from home

David davidtorroija

🏠
Working from home
View GitHub Profile
@davidtorroija
davidtorroija / nightwatch.json
Created April 11, 2016 21:49
nightwatch json file to start e2e tests from scratch
{
"src_folders" : ["tests"],
"output_folder" : "./reports",
"custom_commands_path" : ["./node_modules/nightwatch-commands/commands/","./custom-commands/"],
"custom_assertions_path" : "./node_modules/nightwatch-commands/commands/",
"page_objects_path" : "./page-objects/",
"globals_path" : "",
"skip_testcases_on_fail": "false",
"end_session_on_fail": "false",
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/Capo-Light (SL).tmTheme",
"enable_tab_scrolling": false,
"find_selected_text": true,
"font_size": 16,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
{
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"enable_tab_scrolling": false,
"find_selected_text": true,
"folder_exclude_patterns":
[
"node_modules",
".git",
".sass-cache"
@davidtorroija
davidtorroija / wercker-config-nightwatch-mocha.yml
Created April 11, 2016 21:46
Wercker CI config file to run in a Node Box: nightwatch with mocha, firefox and a custom nightwatch.json that differs from the dev file, also installs java to run selenium
box: node
build:
steps:
- script:
name: setup
code: |
sudo apt-get update -y -qq
- install-packages:
packages: ruby ruby-dev bzr mercurial git wget
- script:
{
"name": "",
"version": "1.0.0",
"description": "",
"homepage": "https://github.com/",
"repository": {
"type": "git",
"url": "git+https://github.com/pepe.git"
},
"//": [],
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<meta charset="utf-8" />
<title>videojs-overlay Demo</title>
<link href="https://vjs.zencdn.net/5-unsafe/video-js.css" rel="stylesheet" />
...
</head>
<body>
Reveal.prototype.resize = function(canvas) {
var _this, challengeToolsDiv, container, footerHeight, headerHeight, height, init_height, init_ratio, init_width, objects, ratio, ref, resize_height, resize_width, scaleX, scaleY, toolsDiv, toolsHeight, width;
_this = this;
init_width = this.init_width;
init_height = this.init_height;
init_ratio = init_width / init_height;
container = $('#widget-container');
resize_width = false;
resize_height = false;
width = container.find('.main')[0].clientWidth;
@davidtorroija
davidtorroija / bounding_box_fabricjs.js
Created September 26, 2016 15:53 — forked from gregtap/bounding_box_fabricjs.js
Get bounding box off all objects on a fabric canvas
getBoardBoundingBox: function(canvas) {
var minX = Number.MAX_VALUE;
var maxX = Number.MIN_VALUE;
var minY = Number.MAX_VALUE;
var maxY = Number.MIN_VALUE;
canvas.forEachObject(function(o){
var rad = o.angle * Math.PI/180;
var w = o.width * o.scaleX;

Keybase proof

I hereby claim:

  • I am davidtorroija on github.
  • I am davidtorroija (https://keybase.io/davidtorroija) on keybase.
  • I have a public key ASCYPBZVc1_aSpt6PMRh2Jee6CUQQb4mjRFHix_JgKrfpQo

To claim this, I am signing this object:

@davidtorroija
davidtorroija / webpack config for karma.js
Created February 15, 2022 16:43
webpack config for karma
const { resolve } = require("path");
const webpack = require("webpack");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { getIfUtils, removeEmpty } = require("webpack-config-utils");
const LodashModuleReplacementPlugin = require("lodash-webpack-plugin");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
const config = require("./config");
const rootResolve = path => resolve(__dirname, path);
const { ifProduction, ifNotProduction, ifDevelopment /*, ifTesting */ } = getIfUtils(process.env.NODE_ENV, [
"production",