Skip to content

Instantly share code, notes, and snippets.

View sg6's full-sized avatar

Stefan Georg Rath sg6

View GitHub Profile
Array.from(document.querySelectorAll('path')).forEach(path => path.dispatchEvent(new Event('mouseover')));
const sectors = Array.from(document.querySelectorAll('path')).filter(path => path.style.stroke === 'rgb(68, 68, 68)');
getCurrentSeats = function() { return Array.from(document.querySelectorAll('#svg-wrapper circle')).length - Array.from(document.querySelectorAll('#svg-wrapper circle')).filter(circle => circle.style.fill === "url(\"#taken-seat\")").length };
async function run() {
let freeSeatsAll = 0;
let i = 0;
@sg6
sg6 / copy.component.ts
Created June 16, 2017 12:16
Copy Content fetched from Web Service to Clipboard with Ctrl + C in Angular 2+
import { Component, OnInit } from '@angular/core';
import { MyService } from './my.service';
// Adapt code to your needs, it's just a component's bootstrap
@Component({
selector: 'app-copy',
template: `
<div class="container" (keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" tabindex="1">
<div>...some data... (click me and press ctrl + c)</div>
@sg6
sg6 / 0_reuse_code.js
Created May 9, 2016 12:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console