Skip to content

Instantly share code, notes, and snippets.

View embarq's full-sized avatar
🕶️
Working hard

Li Ihor embarq

🕶️
Working hard
View GitHub Profile
/**
* Items parser
* ---
* https://liquipedia.net/dota2/Portal:Items
*/
var data = [];
var itemsNodes = document.querySelector('.mw-parser-output').querySelectorAll('div.responsive');
for (let item of itemsNodes.values()) {
const title = document.querySelector<HTMLElement>('.toolbar-content-stub');
const toolbar = document.querySelector<HTMLElement>('.header-footer');
const transformState = toolbar.style.transform.match(/matrix\(([\d\,\s\.\-]+)\)/);
if (transformState == null || (Array.isArray(transformState) && transformState.length < 2)) {
console.warn('[LoginPage.resetToolbarTransform]: Unrecognized transform value, doing nothing', toolbar.style.transform);
return;
}
try {
const path = require('path');
const fs = require('fs');
const qs = require("querystring");
const http = require("https");
const { exec } = require('child_process');
const { promisify } = require('util');
const stackblitz = require('@stackblitz/sdk');
const execAsync = promisify(exec);
const readFileAsync = promisify(fs.readFile);
@embarq
embarq / angular-styleguide.md
Last active November 23, 2018 09:24
Angular Styleguide

Angular Styleguide

This document is the extension of the original Angular Styleguide and overrides some original rules. Must be applied in common.

Components

  1. Imports must be at the beginning of a source file and must keep the following order:
    1. Angular libraries
    2. Angular-related vendor libraries
  2. Other vendor libraries
@embarq
embarq / ionic.scss
Created September 3, 2018 14:11
Fix tappable on ion-input
ion-input:not(.cloned-input) {
pointer-events: initial !important;
}
.ghost-field.cloned-input input {
opacity: 0;
}
.ghost-field:not(.cloned-input) input {
opacity: 1 !important;
/**
* PrivacyScreenPlugin.java Cordova Plugin Implementation
* Created by Tommy-Carlos Williams on 18/07/14.
* Copyright (c) 2014 Tommy-Carlos Williams. All rights reserved.
* MIT Licensed
*/
package org.devgeeks.privacyscreen;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CallbackContext;
const users = [{
"email": "shutchcraft0@un.org",
"id": "186f4765-e2db-4fc0-9b13-0557f922a900",
"ip_address": "38.203.170.215"
}, {
"email": "rrasp1@gov.uk",
"id": "ad79e53c-3d3d-46e2-8d90-c8dd1591d125",
"ip_address": "230.60.100.209"
}, {
"email": "tjepensen2@google.co.uk",
export const HallOfFame = (function() {
/** @argument {Array<any>} players */
const sortPlayers = (players) => {
return players.slice().sort((a, b) => {
if (a.length !== 2 || b.length !== 2) {
console.log('[sortPlayers:except]', a, b);
return -1;
}
@Directive({
selector: '[openNextField]'
})
/**
* @example
* <form>
* <ion-list>
* <ion-item>
* <ion-label>Text field</ion-label>
* <ion-input [openNextField]="selectFieldRef"></ion-input>
@embarq
embarq / Descending Order.js
Last active June 18, 2018 12:50
JS basics
asd