Skip to content

Instantly share code, notes, and snippets.

@Phoenix124
Phoenix124 / squash.sh
Created November 16, 2021 10:29
Squash commits in branch
git merge-base HEAD BRANCH_YOU_BRANCHED_FROM
git reset --soft COMMIT_HASH
git commit -am 'This is the new re-created one commit'
@Phoenix124
Phoenix124 / clear_maven.sh
Created September 27, 2021 14:54
Remove old maven dependencies
find ~/.m2/repository/ -atime +30 -iname '*.pom' -print0 | while read -d '' -r pom; do echo rm -rf "$(dirname $pom)"; done
@Phoenix124
Phoenix124 / sql.sql
Created January 22, 2021 10:11
Stepik sql source
1.1.6
create table book (book_id int primary key auto_increment, title varchar(50), author varchar(30), price decimal(8,2),
amount int);
1.1.7
insert into book (book_id, title, author, price, amount) values (1, "Мастер и Маргарита", "Булгаков М.А.",
670.99, 3)
1.1.8
insert into book (book_id, title, author, price, amount) values (2, "Белая гвардия", "Булгаков М.А.",
@Phoenix124
Phoenix124 / gist:695d2297b3df339de02c23954cfb0033
Created December 2, 2020 13:20 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
[INFO] 18:21:45 BeforeSuite start
[INFO] 18:21:45 Init Environments Queue...
[INFO] 18:21:45 Get Thread Environments...
[INFO] 18:21:45 Starting Appium Server at 127.0.0.1:4724
[Appium] Welcome to Appium v1.18.0-beta.0
[Appium] Non-default server args:
[Appium] address: 127.0.0.1
[Appium] port: 4724
[Appium] callbackPort: 4824
[Appium] sessionOverride: true
@Phoenix124
Phoenix124 / idea
Created June 2, 2020 19:53 — forked from chrisdarroch/idea
Open a project in IntelliJ IDEA from your command line!
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
wd=`ls -1d "$1" | head -n1`
@Phoenix124
Phoenix124 / android_instructions.md
Created June 2, 2020 12:56 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@Phoenix124
Phoenix124 / purgeAndroid.txt
Created June 2, 2020 12:54 — forked from tahmidsadik/purgeAndroid.txt
How to completely remove Android Studio from Mac OS X
How to Completely Remove Android Studio
Execute these commands from the terminal
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
kill -9 $(lsof -i :5563)
@Test
public void testThatWatchedCronExpressionIsCorrect() {
CronTrigger trigger =
new CronTrigger(watchedCron);
Calendar today = Calendar.getInstance();
today.set(Calendar.HOUR_OF_DAY, 9);
today.set(Calendar.MINUTE, 0);
final Date yesterday = today.getTime();
Date nextExecutionTime = trigger.nextExecutionTime(