Skip to content

Instantly share code, notes, and snippets.

@vladkosinov
vladkosinov / day 2.txt
Last active December 3, 2022 10:44
advent 2023
A = Rock
B = Paper
C = Scissors
X = Rock = 1
Y = Paper = 2
Z = Scissors = 3
PART 1
@vladkosinov
vladkosinov / README.md
Created December 17, 2021 11:46
export apple script notes to html
@vladkosinov
vladkosinov / auto-vpn.scpt
Created June 28, 2020 13:00
MacOS reconnect VPN automatically
on idle
set MyVPNName to "VPN NAME IN NETWORK PREFERENCES"
tell application "System Events"
tell current location of network preferences
set myConnection to the service MyVPNName
if myConnection is not null then
if current configuration of myConnection is not connected then
connect myConnection
@vladkosinov
vladkosinov / delete-vps.sh
Created June 21, 2020 09:42
Delete Yandex Cloud VPS script
#!/bin/bash
YC_TOKEN="value"
YC_FOLDER_ID="value"
YC_INSTANCE_NAME="some name"
IAM_TOKEN=$(
curl -s -d "{\"yandexPassportOauthToken\":\"${YC_TOKEN}\"}" \
https://iam.api.cloud.yandex.net/iam/v1/tokens |\
jq --raw-output .iamToken
@vladkosinov
vladkosinov / webpack-nodemon-middleware.js
Created August 15, 2016 12:36
webpack-nodemon-middleware.js
const nodemon = require('nodemon');
const chalk = require('chalk');
const defaultNodemonOptions = {
execMap: { js: 'node' },
runOnChangeOnly: true,
ext: 'noop',
watch: ['noop/'],
@vladkosinov
vladkosinov / webpack-nodemon-middleware.js
Created August 15, 2016 12:36
webpack-nodemon-middleware.js
const nodemon = require('nodemon');
const chalk = require('chalk');
const defaultNodemonOptions = {
execMap: { js: 'node' },
runOnChangeOnly: true,
ext: 'noop',
watch: ['noop/'],
@vladkosinov
vladkosinov / build-stats.json
Created June 20, 2016 23:42
usage example of html-webpack-plugin for stats building
{
"js": [
"js/common-16b95.js",
"js/app-26c95.js"
],
"css": [
"css/common-902b1.css",
"css/app-82c1b.css"
]
}
@vladkosinov
vladkosinov / gist:0463bebd4b23380604db
Created February 17, 2016 16:29
project template
<!doctype html>
<script>
const UPDATES_URL = 'https://api.telegram.org/bot152495481:AAHOp1v7pz-cV3L2C-xiivqNi0qbVOOVNtQ/getUpdates';
</script>
@vladkosinov
vladkosinov / extract-stats.js
Last active January 24, 2016 19:43
Example with overriding HtmlWebpackPlugin params to templateContent function and compilation instance manipulating
import { remove } from 'lodash';
const MANIFEST_CHUNK_NAME_REGEX = /.*manifest\..+\.js/;
export default function (templateParams, compilation) {
const stats = {
styles: templateParams.htmlWebpackPlugin.files.css,
scripts: templateParams.htmlWebpackPlugin.files.js
};
@vladkosinov
vladkosinov / webpack.part.config.js
Created November 2, 2015 20:45
How to use stylelint with postcss loader
{
...
module: {
loaders: [
{test: CSS_REGEX, loaders: ['style', 'css', 'postcss']},
]
},
postcss: () => [require('stylelint'), require('postcss-reporter')]
}