Skip to content

Instantly share code, notes, and snippets.

View shibli049's full-sized avatar

Tahmim Ahmed Shibli shibli049

View GitHub Profile
public static boolean isOsWindows() {
String osName = System.getProperty("os.name");
if (osName != null) {
osName = "";
}
return osName.toUpperCase().contains("WINDOWS");
}
class MagicalObject(object):
def __init__(self, num):
self.num = num
def __eq__(self, other):
return type(self.num) == type(other)
class MagicalObject(object):
def __init__(self, num):
self.num = num
def __eq__(self, other):
self.num += 1
return self.num == other
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Which dependency-injection/autowiring option is better, why?
public class SpringAutowire{
@Autowire
private ClassA a;
private ClassB b;
private ClassC c;
@Autowire
public SpringAutowire(ClassB b){

Add swagger2 documentation

Dependencies

  1. io.springfox:springfox-swagger2:2.4.0
  2. io.springfox:springfox-swagger-ui:2.4.0

Configuration

// Place your settings in this file to overwrite default and user settings.
{
"editor.wrappingColumn": 0,
"files.exclude": {
"**/node_modules": {},
"typings": {},
"**/*.map": {},
"**/*.js": {
"when": "$(basename).ts"
}
@shibli049
shibli049 / git-pushing-multiple.rst
Created June 9, 2018 12:13 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@shibli049
shibli049 / Elastic-Spring-Data.md
Created July 12, 2018 05:27 — forked from rivancic/Elastic-Spring-Data.md
Elastic Springdata Docker

ElasticSearch

Springdata

Reference

Compatible only with version 2.4. Enough for simple data storage functionality.

Dependencies:

import java.util.Hashtable;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.Context;