Skip to content

Instantly share code, notes, and snippets.

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

Alexander CherryTea Akiyamka

🏠
Working from home
View GitHub Profile
@Akiyamka
Akiyamka / readme.bash
Created May 8, 2020 16:40
How to build front end project
# Check node is installed
node -v
# if not, install it
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
nvm install stable
# install yarn
curl -o- -L https://yarnpkg.com/install.sh | bash
const fs = require('fs').promises;
const path = require('path');
const ls = dir => fs.readdir(dir);
async function walk(dir) {
const filesList = await ls(dir);
const files = await Promise.all(filesList.map(async file => {
const filePath = path.join(dir, file);
const stats = await fs.stat(filePath);
if (stats.isDirectory()) return walk(filePath);
{
"$schema": "vscode://schemas/color-theme",
"name": "City Lights Extended",
"type": "dark",
"colors": {
"breadcrumb.foreground": "#718ca1",
"breadcrumb.focusForeground": "#b7c5d3",
"breadcrumb.activeSelectionForeground": "#41505e",
"breadcrumbPicker.background": "#28323a",
1. Добавляем в trusted все необходимое:
firewall-cmd --permanent --zone=trusted --change-interface=docker0
firewall-cmd --permanent --zone=trusted --add-port=80/tcp
firewall-cmd --permanent --zone=trusted --add-service=http
firewall-cmd --permanent --zone=trusted --add-service=https
firewall-cmd --permanent --zone=trusted --add-service=tcp
2. Ищем айпишник докер контейнера с nginx:
systemctl status docker
node build
Installing React / Redux RealWorld example...
Cloning...
Installing Angular RealWorld example...
Cloning...
Installing React / MobX RealWorld example...
Cloning...
Installing Vue RealWorld example...
Cloning...
Installing ClojureScript + re-frame RealWorld example...
@Akiyamka
Akiyamka / addJson.js
Last active February 25, 2020 15:23
node addJson.js command path/to/file.json
const { spawn } = require('child_process');
const { readFile } = require('fs');
const [app, ...args] = process.argv.slice(2, -1);
const pathToJson = process.argv.slice(-1)[0];
readFile(pathToJson, 'utf8', (err, content) => {
if (err) {
console.error(err);
} else {
const command = spawn(app, [...args, content]);
@Akiyamka
Akiyamka / demicode
Last active February 7, 2020 16:30
/sys/class/drm/card0/error
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.
Table at 0x6AE81000.
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
Vendor: American Megatrends Inc.
Version: F.30
Release Date: 10/30/2017
@Akiyamka
Akiyamka / safeMergeObjects.js
Created January 30, 2020 12:01
Safety merge objects
export default function safeMerge(obj1, obj2) {
const keys = Object.keys(obj2).concat(Object.keys(obj1));
const isInvalid = val => val === undefined || Number.isNaN(val) || val === null;
return keys.reduce((acc, key) => {
acc[key] = !isInvalid(obj2[key])
? obj2[key]
: obj1[key];
if (isInvalid(acc[key])) {
delete acc[key];
@Akiyamka
Akiyamka / keybindings.js
Last active December 4, 2019 16:28
Inline comment for vscode
/**
* Author: @anontheanon
* Telegram: https://t.me/anontheanon
**/
// Add inline comment /* */
{
"key": "ctrl+/",
"command": "editor.action.insertSnippet", // ctrl+oem_102 for back slash
"when": "editorHasSelection",
@Akiyamka
Akiyamka / houston_problems.md
Last active November 27, 2019 16:29
Regular problems
  • Storing some data in url
  • Sync url and app statement (app change url, url change app without page refresh)
  • Proxy for remote work
  • Store different build configs (prod, dev, stage, whatever)
  • Project architecture documentation (where to store, how to write)
  • Protection of the application from bad data with the backend or its inaccessibility
  • Map and Interface Interactions
  • Кeeping dependencies up to date
  • Ui translations