Skip to content

Instantly share code, notes, and snippets.

@raevilman
raevilman / stash-pop-recover
Created June 21, 2021 12:23 — forked from davidwalter0/stash-pop-recover
Undoing accidental git stash pop
# https://stackoverflow.com/questions/6543519/undoing-accidental-git-stash-pop
# https://stackoverflow.com/questions/89332/how-to-recover-a-dropped-stash-in-git
accepted
If you have only just popped it and the terminal is still open, you will still have the hash value printed by git stash pop on screen (thanks, Dolda).
Otherwise, you can find it using this for Linux and Unix:
git fsck --no-reflog | awk '/dangling commit/ {print $3}'
and for Windows:

alias glog="git log --pretty=format:"%C(dim white)%h%x09%C(auto)%d%n %C(dim white)%ad%x09%C(no-dim cyan)%an%n %C(white)%s" --graph"

@raevilman
raevilman / kubernetes.md
Created May 30, 2019 17:05
Working with kubectl | Kubernetes

First thing first, its gonna save you a lot of hassle

alias kc="kubectl"
@raevilman
raevilman / Update-branch.md
Created May 20, 2019 10:07 — forked from santisbon/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master

@raevilman
raevilman / git_log_format.md
Last active May 20, 2019 09:13
Formatting git log output

Command

git log --pretty=format:"%C(dim white)%h%x09%C(auto)%d%n %C(dim white)%ad%x09%C(no-dim cyan)%an%n %C(white)%s" --graph

set alias in linux

alias glog="git log --pretty=format:\"%C(dim white)%h%x09%C(auto)%d%n %C(dim white)%ad%x09%C(no-dim cyan)%an%n %C(white)%s\" --graph"
@raevilman
raevilman / oc_helper.sh
Last active October 9, 2022 11:47
GlobalProtect on Ubuntu
#! /bin/bash
# Copied from https://gist.github.com/rtgibbons/ae083457d0962bd3fe3f
### BEGIN INIT INFO
# Provides: openconnect
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
@raevilman
raevilman / README.md
Created July 6, 2018 09:51 — forked from roachhd/README.md
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

.gitignore file for IntelliJ, Eclipse, Maven, Mac

# Eclipse
.classpath
.project
.settings/

# Intellij
.idea/
@raevilman
raevilman / README.md
Last active November 8, 2017 11:02
Slack Guide Infographics

Random

@raevilman
raevilman / SBT_Multi-Module_Project.md
Last active October 6, 2017 07:35
SBT Multi-Module Project

Notes on building multi-module project with sbt in intellij

Configuring multi-module projects with sbt is simple.
In Maven, we need to write a parent pom.xml and child pom.xml files for all of the sub modules.
In sbt you only need to prepare one project file (build.sbt or projecct/Build.scala).

Suppose we have the following folder structure with a parent module (root folder) and two sub modules core and util:

project/Build.sbt