Skip to content

Instantly share code, notes, and snippets.

View alexcrown's full-sized avatar

Alex Crown alexcrown

  • Colvir Software Solutions
  • Moscow, Russia
View GitHub Profile
@ricardozanini
ricardozanini / How-to-add-custom-spring-module-wildfly.md
Last active December 9, 2020 03:12
Add a Spring Framework Web Custom module to Wildfly/JBoss/EAP
  1. Create a module.xml file in $JBOSS_HOME/modules/org/springframework/${spring-version}:
<?xml version="1.0"?>
<module xmlns="urn:jboss:module:1.1" name="org.springframework" slot="${spring-version}">
    <resources>
            <resource-root path="aopalliance-1.0.jar" />
            <resource-root path="spring-aop-${spring-version}.jar" />
            <resource-root path="spring-beans-${spring-version}.jar" />
            <resource-root path="spring-context-${spring-version}.jar" />
@rambabusaravanan
rambabusaravanan / .gitconfig
Last active July 12, 2024 07:14
Git Diff and Merge Tool - IntelliJ IDEA
# Linux
# add the following to "~/.gitconfig" file
[merge]
tool = intellij
[mergetool "intellij"]
cmd = /usr/local/bin/idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
[diff]
@colingourlay
colingourlay / example.js
Last active October 22, 2021 15:16
Lodash / Underscore sort object keys. Like _.sortBy(), but on keys instead of values, returning an object, not an array. Defaults to alphanumeric sort.
var obj = {b: 3, c: 2, a: 1};
_.sortKeysBy(obj);
// {a: 1, b: 3, c: 2}
_.sortKeysBy(obj, function (value, key) {
return value;
});
// {a: 1, c: 2, b: 3}
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

#!/bin/bash
echo '#!/bin/bash'
echo ''
echo 'failed_items=""'
echo 'function install_package() {'
echo 'echo EXECUTING: brew install $1 $2'
echo 'brew install $1 $2'
echo '[ $? -ne 0 ] && $failed_items="$failed_items $1" # package failed to install.'
echo '}'
@willurd
willurd / web-servers.md
Last active July 25, 2024 21:14
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000