Skip to content

Instantly share code, notes, and snippets.

View farukh-dm's full-sized avatar

Farukh D M farukh-dm

View GitHub Profile
Show all remote branches
------------------------
git branch -r
Checkout remote branch:
------------------------
With newer versions, you can simply use:
git fetch
@farukh-dm
farukh-dm / SQL-Util
Last active August 4, 2020 15:28
SQL-Util
select * from DBA_PROCEDURES where OBJECT_NAME like 'PROC_NAME' ;
Query to find modified DB objects
-----------------------------
select object_name,object_type, max(CREATED) from USER_OBJECTS where object_type like 'PROC%' group by object_name, object_type order by 3 desc;
select object_name,object_type, Created from DBA_OBJECTS where object_type like 'PROC%' and object_name = 'PROC_NAME';
DBA_OBJECTS describes all objects in the database.
USER_OBJECTS describes all objects owned by the current user.
Spring is like a container of beans or factory of beans.
And you ask the container to give you what you need. Container reads from some configuration setup avaialable for it & returns thw required object.
BeanFactory will help create new objects by reading some configuration.
We can use BeanFactory object to create target objects. And as the object is created in Bean Factory, Spring handles the life cycle of the object.
spring DI
BeanFactory f = new XmlBF(new FileSystemResouce(spring.xml))
f.getBean(..)
----------------------------------
BeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource("C:/workspace/project/spring-demo-1/src/main/resources/spring/spring-config.xml"));
@farukh-dm
farukh-dm / dynamically-setting-log-level
Created October 31, 2017 13:07
Setting log level for a class or package dynamically
Setting log level for a class or package dynamically.
-----------------------------------------------------
LoggerContext loggerContext = (LoggerContext)LoggerFactory.getILoggerFactory();
Logger rootLogger = loggerContext.getLogger("com.demo.blah1.blah2"); // class or package
((ch.qos.logback.classic.Logger) rootLogger).setLevel(Level.INFO)
@farukh-dm
farukh-dm / add-existing-project-to-git.txt
Last active October 25, 2017 13:04
Things to do while adding an existing project to GitHub.
1. Follow the link https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
2. While copying the link from git to add paste it into an editor, then copy paste it to the command:
git remote add origin <https://github.com/user/repo.git>
3. First, pull the latest changes from repository.
4. If you get an error "fatal: refusing to merge unrelated histories" for: "git pull origin master",
run: "git merge origin/master --allow-unrelated-histories"
5. Then run: "git pull origin master"
6. Finally you may run:"git push origin master" to push your changes to the repository.