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 / UTF8Control.java
Created January 2, 2019 03:22 — forked from DemkaAge/UTF8Control.java
ResourceBundle UTF-8 Control class
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.Locale;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
@landsman
landsman / ec2-root-resize.sh
Created December 3, 2018 19:25 — forked from kshcherban/ec2-root-resize.sh
ec2 root volume resize
#!/bin/bash -e
if [ $# -ne 2 ]; then
echo "Usage: $0 <instance-id> <volume-size-gb> [PARITION_NAME=/dev/xvda2]"
exit 2
fi
sudo apt-get install jq -y
@landsman
landsman / start.bat
Created August 8, 2017 14:07 — forked from jbutko/start.bat
Git: Merge redundand commits into one
git reset --soft HEAD~7
git commit -m "Add stickyNavbar.js"
git push --force
REM From https://github.com/jsdelivr/jsdelivr/pull/843
@landsman
landsman / squash-commits.sh
Created July 26, 2017 13:56 — forked from jbub/squash-commits.sh
git squash last two commits into one
git rebase --interactive HEAD~2
# we are going to squash c into b
pick b76d157 b
pick a931ac7 c
# squash c into b
pick b76d157 b
s a931ac7 c
@landsman
landsman / gist:7e3741abd384f1606009cf02770cda9a
Created August 31, 2016 14:39 — forked from elcontraption/gist:4028550
WordPress change domain query
SET @old_domain = 'http://olddomain.com';
SET @new_domain = 'http://newdomain.com';
UPDATE wp_options SET option_value = replace(option_value, @old_domain, @new_domain) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE (guid, @old_domain, @new_domain);
UPDATE wp_posts SET post_content = REPLACE (post_content, @old_domain, @new_domain);
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, @old_domain, @new_domain);