Skip to content

Instantly share code, notes, and snippets.

View WeslyG's full-sized avatar
🎯
Focusing

Vladimir Lila WeslyG

🎯
Focusing
  • Yandex.Cloud
  • Yekaterinburg
View GitHub Profile
file, err := ioutil.ReadFile("/path/to/index.txt")
if err != nil {
fmt.Print(err)
}
str := string(file)
fmt.Println(str)
@WeslyG
WeslyG / hyper
Last active May 6, 2019 14:57
js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@WeslyG
WeslyG / .editconfig
Created July 1, 2019 11:17
.editconfig
# EditorConfig is awesome: http://EditorConfig.org
root = true
[*]
charset = utf-8
indent_size = 2
end_of_line = lf
indent_style = space
insert_final_newline = true
@WeslyG
WeslyG / dlib dockerfile
Created August 2, 2019 07:56
dlib ubuntu docker
FROM ubuntu:18.10
RUN apt-get update && \
apt-get install build-essential cmake -y && \
apt-get install libopenblas-dev liblapack-dev -y && \
apt-get install libx11-dev libgtk-3-dev -y && \
apt-get install python python-dev python-pip -y && \
apt-get install python3 python3-dev python3-pip -y
# build ~3-4 hours(!) on i7 8700k + 960pro (nvme ssd)
@WeslyG
WeslyG / js
Created September 15, 2019 18:08
express
import express from 'express';
import { createEvent } from '../controllers/Events/createEvent';
import { getEvents } from '../controllers/Events/getEvents';
import { updateEvent } from '../controllers/Events/updateEvent';
import { deleteEvent } from '../controllers/Events/deleteEvent';
const router = express.Router();
router.route('/events')
.get(async (req, res) => {
// all action in controller
@WeslyG
WeslyG / elk6
Last active March 24, 2020 18:00
Elasticsearch 6 docker-compose + kibana
version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.7
ports:
- 9200:9200
- 9300:9300
environment:
- discovery.type=single-node
@WeslyG
WeslyG / adguard block list
Last active January 12, 2021 11:55
Adguard
vk.com###stories_feed_wrap
stackoverflow.com###js-gdpr-consent-banner
99percentinvisible.org###cookie-policy
serverfault.com###js-gdpr-consent-banner
superuser.com###js-gdpr-consent-banner
vk.com##.feed_friends_recomm
vk.com###feed_filters
ntv.ru###newcontent
unix.stackexchange.com###js-gdpr-consent-banner
askubuntu.com###js-gdpr-consent-banner
@WeslyG
WeslyG / Ansible
Last active December 25, 2021 15:31
Shell Usage
# roles when
roles:
- { role: main, when: inventory_file|basename == 'inventory' }
# WSL connection bug
# https://stackoverflow.com/questions/62363901/ansible-msg-failed-to-create-temporary-directory-in-some-cases-fatal
mv /usr/bin/sleep /usr/bin/sleep.dist
ln -s /bin/true /usr/bin/sleep
# Run locally
@WeslyG
WeslyG / gist:1e7c2c753f369e5294acf7e25b2073d2
Created April 5, 2022 06:46
powershell pre-commit hook with sh
#!/bin/sh
tscCommand="powershell.exe yarn tsc"
lintCommand="powershell.exe yarn lint"
echo "[HOOK] Running tsc..."
q=$(exec $tscCommand)
result=$?
if [ "$result" != "0" ]
then
@WeslyG
WeslyG / gist:42348d88e79c1a5531c00fd0df6d527d
Created May 25, 2022 06:06
Курс доллара московская биржа home assistant
- name: Курс евро Московская биржа
platform: rest
resource: https://iss.moex.com/iss/engines/currency/markets/selt/boards/CETS/securities/EUR_RUB__TOM.json?iss.meta=off&marketdata.columns=LAST,VALUE&securities.columns=n
value_template: "{{ value_json.marketdata.data[0][0] }}"
unit_of_measurement: "rub"
scan_interval: 600
- name: Курс доллара Московская биржа
platform: rest
resource: https://iss.moex.com/iss/engines/currency/markets/selt/boards/CETS/securities/USD000UTSTOM.json?iss.meta=off&marketdata.columns=LAST,VALUE&securities.columns=n
value_template: "{{ value_json.marketdata.data[0][0] }}"