Skip to content

Instantly share code, notes, and snippets.

View mahbodkh's full-sized avatar
🔮
Focusing

Abe K mahbodkh

🔮
Focusing
  • Benify AB
  • Gothenburg, Sweden
View GitHub Profile
@mahbodkh
mahbodkh / zshrc
Created August 17, 2020 13:25
zshrc_custome
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/mahbod/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@mahbodkh
mahbodkh / Animal.java
Last active July 17, 2018 10:57
Builder Design Pattern
public class Animal {
private int code;
private String name;
private int age;
private Animal(AnimalBuilder builder) {
this.code = builder.code;
this.name = builder.name;
this.age = builder.age;
@mahbodkh
mahbodkh / .gitignore
Last active July 21, 2018 06:46 — forked from lordofthelake/.gitignore
.gitignore for Maven, Intellij, Eclipse
# Operating System Files
*.DS_Store
Thumbs.db
*~
.#*
#*
*#
# Build Files #

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@mahbodkh
mahbodkh / add_intellij_launcer
Created November 28, 2017 14:48 — forked from rob-murray/add_intellij_launcer
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ
@mahbodkh
mahbodkh / Spring.java
Created September 16, 2017 07:54
Spring-Boot Example Classes
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.time.LocalDateTime;
package thread;
import java.util.ArrayList;
import java.util.List;
class Producer extends Thread {
private final List<Integer> list;
Producer(List<Integer> list) {
@mahbodkh
mahbodkh / websocket.client.js
Created August 20, 2017 06:17
javascript websocket client
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
</head>
<body>
<form>
<input id="textMessage" type="text">
<input onclick="sendMessage();" value="send message" type="button">
</form>
@mahbodkh
mahbodkh / riak-advanced.config
Created August 7, 2017 11:36
/etc/riak-cs/advanced.config
[
{riak_kv, [
{add_paths, ["/usr/lib/riak-cs/lib/riak_cs-2.1.0/ebin"]},
{storage_backend, riak_cs_kv_multi_backend},
{multi_backend_prefix_list, [{<<"0b:">>, be_blocks}]},
{multi_backend_default, be_default},
{multi_backend, [
{be_default, riak_kv_eleveldb_backend, [
{total_leveldb_mem_percent, 30},
{data_root, "/var/lib/riak/leveldb"}
@mahbodkh
mahbodkh / log4j.properties
Created July 23, 2017 12:39
slf4j with log4j properties file :)
log4j.rootLogger=INFO, stdout
# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
#log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.appender.stdout.layout.ConversionPattern=[%-5p] :: %d {%c} - (%F:%L) - %m%n
#############################################