Skip to content

Instantly share code, notes, and snippets.

@vladkosinov
vladkosinov / bundle-wtih-node.sh
Last active September 6, 2024 16:48
tsup + sea + .node addon
node --experimental-sea-config sea-config.json
cp $(command -v node) ./run-gateway-pr-check
npx --yes postject run-gateway-pr-check NODE_SEA_BLOB run-gateway-pr-check.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 copy
@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')]
}