Skip to content

Instantly share code, notes, and snippets.

View impankratov's full-sized avatar
🎯
Focusing

Ivan Pankratov impankratov

🎯
Focusing
View GitHub Profile
@impankratov
impankratov / index.js
Created May 22, 2019 11:10
Tasmota power calibration
// ==UserScript==
// @name tasmota-calibration
// @namespace http://tampermonkey.net/
// @version 1.0
// @description try to take over the world!
// @author yu_ya45
// @match http://*/
// @grant none
// ==/UserScript==
@impankratov
impankratov / index.ts
Created May 21, 2019 06:46
Get size of an image from S3 bucket
// Wrote this, but because of this issue:
// https://github.com/image-size/image-size/issues/37
// had to switch to https://www.npmjs.com/package/probe-image-size
import * as sizeOf from 'image-size';
export const getImageSize = (bucket: string) => (
key: string
): Promise<ImageSize> =>
new Promise((resolve, reject) => {
@impankratov
impankratov / install.sh
Created January 2, 2019 20:25
msoffice2007
env WINEPREFIX=~/.local/share/wineprefixes/office2007pro wine /setup.exe
@impankratov
impankratov / resize.sh
Created November 30, 2018 15:44
Batch resize images (image-magick, mogrify)
mogrify -define jpeg:extent=2000kb *.jpg
@impankratov
impankratov / todo
Last active January 8, 2019 20:28
Archlinux todo
-------------------------------------------------------------
% RCRC="$HOME/.dotfiles/host-$(hostname)/config/rcrc" rcup
-------------------------------------------------------------
add user groups:
docker wheel
sudo gpasswd -a impankratov docker
sudo gpasswd -a impankratov wheel
-------------------------------------------------------------
change shell chsh
-------------------------------------------------------------
@impankratov
impankratov / handlebars.js
Last active September 8, 2021 15:59
Example of registering custom handlebars helpers (+ handlebars-form-helpers) with webpack
// Import Handlebars runtime lib
const Handlebars = require('handlebars/runtime');
const register = require('handlebars-form-helpers').register;
const { registerHandlebarHelpers } = require('../../some/other/place');
// Register extra helpers
register(Handlebars);
registerHandlebarHelpers(Handlebars);
@impankratov
impankratov / git-config.sh
Created April 29, 2018 14:37
Set git to use gnome-keyring
git config --global credential.helper gnome-keyring
@impankratov
impankratov / PKGBUILD
Created March 7, 2018 09:52
Archlinux Upwork PKGBUILD
# Maintainer: Lev Lybin <lev.lybin at gmail dot com>
# Maintainer: Maksym Sheremet <msheremet at sheremets dot com>
pkgname=upwork
pkgver=5.0.1.404
_rawver=${pkgver//./_}
_hashver="e83l5wbauyxiky5x"
pkgrel=4
pkgdesc="Desktop App (aka Team App) Standard version"
arch=('x86_64')
@impankratov
impankratov / microservice-webpack.config.ts
Created January 21, 2018 17:37
Microservices multi-config
// Somewhere in microservice folder
// Can be used to create a bundle for this specific microservice
import { resolve } from 'path';
import * as webpack from 'webpack';
import config, { Env } from '../../webpack.config';
export default (env: Env = {}): webpack.Configuration => {
env.BUNDLE_FOLDER = resolve(__dirname, 'bin');