Goal: sometimes we need to modify a date… Like in this simple case. Let’s add 5 minutes to the actual time. Easy with the java.util.Calendar class. Nota bene: this class can use years, hours, minutes… as well
date manipulation
12:18 |
android |
615 views
scrollable TextView in android
11:09 |
android |
634 views
Goal: making a TextView scrollable put two lines to the layout file: plus to the activity:
Goal: making a TextView scrollable put two lines to the layout file: plus to the activity:
add horizontal line to the activity
11:00 |
android |
582 views
Goal: create an easy visual separator element Use only one line to create a line… where the dialogFragment_horizontal_line style is like this: nota bene: the color coming from style as well
Goal: create an easy visual separator element Use only one line to create a line… where the dialogFragment_horizontal_line style is like this: nota bene: the color coming from style as well
freeze portrait orientation
10:51 |
android |
595 views
Goal: avoid the screen rotation If you want to ignore the rotation of the device you can freeze the orientation like this. Put the following line into the manifest file (AndroidManifest.xml) under the activity section:
Goal: avoid the screen rotation If you want to ignore the rotation of the device you can freeze the orientation like this. Put the following line into the manifest file (AndroidManifest.xml) under the activity section:
Reset the scroll position on the page
15:27 |
javascript |
734 views
Goal: reset the scroll position If the page content is dinamically loaded sometimes we need to reset the scroll position of the page. Like this:
Goal: reset the scroll position If the page content is dinamically loaded sometimes we need to reset the scroll position of the page. Like this:
store object in the SessionStorage
10:27 |
javascript |
768 views
Goal: to store object on the client side The following code is simple not working: the result is: We need to stringify the object before the store like this: now the result is: and we are happy…
Goal: to store object on the client side The following code is simple not working: the result is: We need to stringify the object before the store like this: now the result is: and we are happy…
kill oracle session without gui
13:59 |
oracle |
772 views
Goal: a simple way to kill a session in Oracle If we know the SID of the session to be killed, then use the following select to create the immediate command:
Goal: a simple way to kill a session in Oracle If we know the SID of the session to be killed, then use the following select to create the immediate command:
Class with optional new keyword
20:49 |
javascript |
781 views
Goal: create class allow creation without the new keyword The pattern is simple: The creation itself is the following:
Goal: create class allow creation without the new keyword The pattern is simple: The creation itself is the following:
list of chrome resources
17:42 |
javascript |
1030 views
Goal: there was no reason There is a simple mode to list some resources from the Chrome. I have digged the following resource ids from the chrome.dll file. This code running on an empty page! Paste the following code to the developer consol and see the result.
Goal: there was no reason There is a simple mode to list some resources from the Chrome. I have digged the following resource ids from the chrome.dll file. This code running on an empty page! Paste the following code to the developer consol and see the result.
get chrome version number
9:44 |
javascript |
804 views
Goal: simple and quick way to find the version of the browser Be careful this is only for Chrome and based on the user agent string. the user agent string is: and the extracted result is:
Goal: simple and quick way to find the version of the browser Be careful this is only for Chrome and based on the user agent string. the user agent string is: and the extracted result is: