Skip to content

Instantly share code, notes, and snippets.

View xshyamx's full-sized avatar
🎯
Life before death, strength before weakness, journey before destination

shyam xshyamx

🎯
Life before death, strength before weakness, journey before destination
View GitHub Profile
@xshyamx
xshyamx / Makefile
Created December 2, 2023 03:52
simple-plantuml-mode elpaca bugfix
.PHONY: emacs clean
EMACS ?= emacs
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))
emacs:
$(EMACS) --init-directory=$(mkfile_dir)
clean:
rm -fr eln-cache elpaca auto-save-list *~ *.png
@xshyamx
xshyamx / tmux-cheatsheet.markdown
Created February 15, 2018 05:06 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@xshyamx
xshyamx / gav.sh
Created January 22, 2018 05:17
Shell script to generate a maven pom.xml from a list of jars
#!/bin/sh
lib_dir="$1"
if [ "$lib_dir" == "" ]; then
echo Please specifiy the directory for the jars
exit 1
fi
cat <<EOF | tee pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
@xshyamx
xshyamx / image.resize.in.github.flavored.markdown.md
Last active March 7, 2017 10:35 — forked from uupaa/image.resize.in.github.flavored.markdown.md
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=50)
@xshyamx
xshyamx / yasnippet.md
Created July 14, 2016 08:22
Yasnippet prevent major-mode indentation

Yasnippets which get included usually have the major mode indentation applied. In cases where you need to disable this use # expand-env: ((yas-indent-line 'fixed)) to prevent this (Thanks to this stackoverflow quesion).

@xshyamx
xshyamx / docker-machine.md
Created June 21, 2016 09:21
Create docker machine behind a proxy

To create a docker machine VM which connects via a proxy running on the host machine on port 9090

docker-machine create -d virtualbox \
               --engine-env HTTP_PROXY=http://10.0.2.2:9090 \
               --engine-env HTTPS_PROXY=http://10.0.2.2:9090 \

dm-name

@xshyamx
xshyamx / toggle-wifi.sh
Created December 8, 2015 06:55
Toggle WiFi on and off from the command line
# simple commands to (dis)connect from wifi network
# docker-machine and docker are unable to handle the changing ip addresses :(
# but once, disconnect and reconnect everything is happy in paradise :)
wifi_off() {
netsh wlan show interfaces > /tmp/wifi_status
status=$(awk -F: '/State/ {gsub(/^ *| *$/, "", $2); print$2; }' /tmp/wifi_status)
name=$(awk -F: '/Name/ { gsub(/^ *| *$/, "", $2); print$2; }' /tmp/wifi_status)
if [ "$status" = "connected" ]; then
netsh wlan disconnect interface="$name"
fi
@xshyamx
xshyamx / Build guideline for MSYS2-MinGW-w64 system.md
Created December 8, 2015 06:49
Build guideline for MSYS2-MinGW-w64 system

Build guideline for MSYS2-MinGW-w64 system

Set up the MSYS2/MinGW-w64 build environment

Download the x86_64 version of MSYS2 in here and install in your preferred directory, e.g. C:\msys64. Note that path containing spaces may causes problems. Run msys2_shell.bat in the C:\msys64 and you will see a BASH window opened. In the BASH prompt, use the following commands to install the necessary packages:

pacman -S base-devel mingw-w64-x86_64-toolchain \
mingw-w64-x86_64-xpm-nox mingw-w64-x86_64-libtiff \
mingw-w64-x86_64-giflib mingw-w64-x86_64-libpng \

mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-librsvg \

@xshyamx
xshyamx / Web Resource Optimization Tools Roundup.md
Last active August 29, 2015 14:16
Web Resource Optimization Tools Roundup

Web Resource Optimization Tools

Comparison of 3 web resource optimization tools available for Java/JEE development.

[wro4j][wro4j]

  • Maven support
  • Taglib support (not built-in but community developed [wro4j-taglib][wro4j-taglib] available)
  • XML/Groovy configuration
  • Uglify javascript compression supported
  • Command line processor available
@xshyamx
xshyamx / LineCount.java
Created March 5, 2015 13:26
Line Count Benchmark
import java.io.BufferedReader;
import java.io.FileReader;
public class LineCount {
public static void main(String[] args) throws Exception {
String filename = "csv/order-details-filtered.csv";
if ( args.length > 2 ) {
filename = args[2];
}