Skip to content

Instantly share code, notes, and snippets.

View landsman's full-sized avatar

Michal Landsman landsman

View GitHub Profile
@landsman
landsman / uao.md
Created May 3, 2024 14:15 — forked from sgyyz/uao.md
uao command - unzip your project and import to intellij automatically
  1. import project into idea command
$ curl -L "https://gist.githubusercontent.com/chrisdarroch/7018927/raw/9a6d663fd7a52aa76a943fe8a9bc6091ad06b18d/idea" -o /usr/local/bin/idea
$ chmod +x /usr/local/bin/idea
  1. unzip and open project command
$ curl -L "https://gist.githubusercontent.com/sgyyz/adfa4f05af3d81cf0e17e19cf7044c85/raw/b6b9e871d5a4f5435a09d00b0a52e3db0b90699a/uao.sh" -o /usr/local/bin/uao.sh
$ chmod +x /usr/local/bin/uao.sh
$ ln -sf /usr/local/bin/uao.sh /usr/local/bin/uao
@landsman
landsman / facebook_crawler.sh
Last active February 19, 2024 01:10
Cloudflare IP address whitelist for Google Crawlers, Google Ads: https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot
#!/bin/bash
#
# see: https://developers.facebook.com/docs/sharing/webmasters/crawler/
#
# Run the whois command and store the output in a variable
whois_output=$(whois -h whois.radb.net -- '-i origin AS32934')
# Use grep to extract lines starting with "route"
@landsman
landsman / aws_iam_sso_billing.md
Created July 4, 2023 12:40
AWS tutorials that works for me
@landsman
landsman / postgres_app_mac_os.md
Last active June 26, 2023 15:38
How to work with postgresapp.com on macOS 👏

PostgreSQL on macOS

Remember: Terminal app is your friend, not enemy.

Start

  1. install the app
  2. click on plus icon in the bottom left corner
  3. create a new server: name, version, other form fields left with default values
  4. click to Initialize
@landsman
landsman / fix_airbank_ib.js
Last active June 15, 2023 10:59
Dear Airbank, this is tutorial how to fix your Internet Banking. Leave me there email where can I send invoice. Thanks. https://twitter.com/Landsman/status/1092498627954655236
let popHandler = () => {
document.getElementById("id22a").click(); // click on your stupid fake go back button
}
window.addEventListener('popstate', popHandler, {once: true})
window.history.pushState(null,null,null)
@landsman
landsman / draft.js
Last active December 6, 2022 18:06
automatic convert bootstrap v. 3 to bootstrap v. 4 idea ... more on https://github.com/twbs/bootstrap/blob/v4-dev/docs/4.0/migration.md, http://upgrade-bootstrap.bootply.com/
let gulp = require('gulp'),
replace = require('gulp-batch-replace'),
filesExist = require('files-exist');
gulp.task('bt4', () =>
{
let diff = {
'@media (min-width: $screen-xs-min) and (max-width: $screen-sm-max)': '@media (min-width: map-get($grid-breakpoints, xs)) and (max-width: map-get($grid-breakpoints, xs))',
'@media (min-width: $screen-xs) and (max-width: ($screen-md-min - 1))': '@media (min-width: map-get($grid-breakpoints, xs)) and (max-width: map-get($grid-breakpoints, md)-1)',
@landsman
landsman / gcp-storage-assets.sh
Created August 13, 2021 06:05
test script to send next.js assets to google storage
#!/bin/sh
export ASSETS_FOLDER="../.next/static"
export GCP_BUCKET="eu.apps.trisbee.com/pay"
export VERSION="test-gzip-3"
TIME_START=$(date +%s)
gsutil -m -q \
cp -r -z "js,css,html,json" \
@landsman
landsman / myFAQ.js
Last active April 23, 2021 10:59
draft how to handle faq data for multiple countries on company site
//
// this is my wanna be database
//
// a) I can turn off/on every faq item for each individual country
// b) all locales are by default handled via lingui, and there are no duplicates
// c) it can be easily refactored to API response in future :)
//
export const faqItems = [
{
id: 'whenMoney',
@landsman
landsman / .bash_aliases
Created April 18, 2021 11:02
compress file with progress bar
function compress () {
if [ -z "$1" ]; then
# display usage if no parameters given
echo "Usage: compress <path/folder-or-file> <new-file.tar.gz>"
return 1
fi
tar cf - $1 -P | pv -s $(du -sb $1 | awk '{print $1}') | gzip > $2
}
@landsman
landsman / domains.txt
Last active October 25, 2020 20:24
email domains fixer
# gmail typos
gmall.com,gmail.com
gmeil.com,gmail.com
gmaol.com,gmail.com
gnail.com,gmail.com
gmaii.com,gmail.com
gmail.comm,gmail.com
gmail.con,gmail.com
gmaiiil.com,gmail.com
gmil.com,gmail.com