Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

David davidtorroija

🏠
Working from home
Block or report user

Report or block davidtorroija

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davidtorroija
davidtorroija / bounding_box_fabricjs.js
Created Sep 26, 2016 — forked from coulix/bounding_box_fabricjs.js
Get bounding box off all objects on a fabric canvas
View bounding_box_fabricjs.js
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;
View resize canvas
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;
View xhtml
<!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>
View package json example
{
"name": "",
"version": "1.0.0",
"description": "",
"homepage": "https://github.com/",
"repository": {
"type": "git",
"url": "git+https://github.com/pepe.git"
},
"//": [],
View Preferences with material theme
{
"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 / nightwatch.json
Created Apr 11, 2016
nightwatch json file to start e2e tests from scratch
View nightwatch.json
{
"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",
View Preferences.sublime-settings
{
"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"
@davidtorroija
davidtorroija / wercker-config-nightwatch-mocha.yml
Created Apr 11, 2016
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
View wercker-config-nightwatch-mocha.yml
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:
You can’t perform that action at this time.