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
@embarq
embarq / README.md
Last active November 29, 2019 13:00
Remote development with VSCode & GCloud Compute Engine

Set up GCloud Compute Instance

  1. Create instance
  2. Create ssh key for remote host access locally: ssh-keygen -t rsa -C {host_username}
  3. Add ssh public keys to .ssh/authorized_keys on the host side
  4. Connect to host via ssh {host_username}@{host_ip}

If you want to use a specific port for local preview it needs to be available by setting up a firewall rule:

  1. Create new rule for a tag:
@embarq
embarq / temp.md
Last active September 10, 2019 12:10

Variables

  1. Immutable data-manipulations
// Instead of

const data = [ /*  */ ];
data.push(100, 200, 300);
@embarq
embarq / settings.json
Created August 30, 2019 10:55
VSCode settings
{
"diffEditor.ignoreTrimWhitespace": true,
"editor.cursorBlinking": "phase",
"editor.cursorStyle": "line",
"editor.dragAndDrop": false,
"editor.fontFamily": "Menlo, monospace",
"editor.formatOnPaste": false,
"editor.multiCursorModifier": "ctrlCmd",
"editor.renderControlCharacters": true,
"editor.snippetSuggestions": "top",
/**
* 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",