Skip to content

Instantly share code, notes, and snippets.

View unrelentingfox's full-sized avatar
🤓
Learning

Dustin unrelentingfox

🤓
Learning
  • Clearwater Analytics
  • USA
View GitHub Profile
@unrelentingfox
unrelentingfox / repoclean.sh
Created October 31, 2017 00:21
A bash script for removing .gitignore files from git history
#!/bin/bash
set -o errexit
if [ $# -eq 0 ]; then
echo "No directories specified. Exiting."
exit
fi
# make sure we're at the root of git repo
if [ ! -d .git ]; then
@unrelentingfox
unrelentingfox / visualizer.ini
Created December 24, 2017 00:28
A visualizer for rainmeter. Modified from Stepris skin. Original author: Tanjil Ahmed
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; DEVELOPER OPTIONS
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;------------------------------------
[Rainmeter]
Author=T-Skins | Tanjil Ahmed
ContextTitle="Stepris Config"
ContextAction=["#@#\Variables\config.exe"]
#!/bin/bash
# This script is for git-svn, just a quick way to copy ignores from svn repo to local git repo.
# Also appends intellij specific files to ignore since I'm the only one on my team that uses intellij.
GREEN='\033[0;36m'
if [ -e ".git" ]; then
printf "${GREEN}Copying ignore file from Subversion..\n"
git svn show-ignore > .git/info/exclude
wait
printf "Adding intellij specific files to ignore..\n"
@unrelentingfox
unrelentingfox / git-svn-rebase-all.sh
Last active July 11, 2018 20:58
Run a git svn fetch on all directories in the current directory that contain a .git file.
#!/bin/bash
GREEN='\033[0;36m'
NC='\033[0m' # No Color
printf "Running git svn fetch on all directories..\n"
for d in */ ; do
cd "$d"
if [ -e ".git" ]; then
printf "${GREEN}$d${NC}\n"
git svn fetch
wait
@unrelentingfox
unrelentingfox / NullSafe.java
Created July 27, 2018 20:22
Useful java safe comparison helper functions
private static boolean safeEquals(Integer first, Integer second) {
return (first == null && second == null) || (first != null && first.equals(second));
}
private static boolean safeContains(String str, String substr) {
return str != null && str.contains(substr);
}
private static <K> List<K> safe(List<K> list) {
return list != null ? list : Collections.EMPTY_LIST;
@unrelentingfox
unrelentingfox / run-on-children.sh
Last active August 20, 2018 22:34
Runs whatever bash commands you enter as parameters from each child directory. WARNING: this could be potentially distructive.. Use at your own risk.
#!/bin/bash
# Runs whatever bash commands you enter as parameters from each child directory.
CYAN=$'\e[0;36m'
RED=$'\e[31m'
NO_COLOR=$'\e[0m'
CLEAR=$'\e[K'
INVERTED=$'\e[7m'
UNINVERTED=$'\e[27m'
find main | grep -P 'Rule.java$' > testfile
sed 's/main/test/g' testfile | sed 's/Rule\.java/RuleTest\.java/g' > final
cat final | xargs -L 1 mkdir -p
# delete till end of line
dt$
# For use when you need trace level logs
status = error
name = PropertiesConfig
filters = threshold
filter.threshold.type = ThresholdFilter
filter.threshold.level = trace
appenders = console
<code_scheme name="Titan (hand entered)" version="173">
<option name="SOFT_MARGINS" value="120" />
<JavaCodeStyleSettings>
<option name="SPACE_AROUND_TYPE_BOUNDS_IN_TYPE_PARAMETERS" value="false" />
<option name="BLANK_LINES_AROUND_INITIALIZER" value="0" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
</JavaCodeStyleSettings>
<SqlCodeStyleSettings version="2">
<option name="ALIAS_CASE" value="1" />