Code Library

 
Showing 1-30 of 336 entries by date posted
Simple function to extract URL parameters
Simple function to extract URL parameters
LotusScript
Clear hashtag from address bar
Clear hashtag from address bar
JavaScript
Force browser to always print the background colors, regardless of the user's settings
Force browser to always print the background colors, regardless of the user's settings
CSS • HTML
How to Protect/Unprotect Multiple Worksheets At Once in Excel
How to Protect/Unprotect Multiple Worksheets At Once in Excel
If you have a workbook contains multiple protected worksheets with the same password, and now you need to unprotect them for modifying some information. Maybe, you can unprotect the sheets one by one with Unprotect Sheet in Excel, but this will waste a lot of time when there are multiple sheets need to be unprotected. Here, I will introduce you some quick ways to unprotect multiple protected sheets.
Microsoft Excel • Vba Script
Slowly hide success and error message divs and remove the query string from the URL
Slowly hide success and error message divs and remove the query string from the URL
When you display content based on the presence of a URL query string value. For example
"http://website.com/page.html&smsg=You saved successfully"
will display the message, fade out after X seconds (2.5 seconds below) and then remove the query string from the address bar to display just this
"http://website.com/page.html"
JavaScript • JQuery
Mask email addresses from web-bots via jQuery
Mask email addresses from web-bots via jQuery
This little snippet won't display the email address unless javascript is enabled in the browser, which web-bots do not run. The fully formatted email address won't be present in the html file, just in the browser ram.
HTML • JQuery
Bootstrap 4 responsive tables won't take up 100% width
Bootstrap 4 responsive tables won't take up 100% width
As soon as you apply the .table-responsive class to a table, the table shrinks horizontally and no longer takes up 100% of the width.
Bootstrap 4 • HTML
Simple breakpoint viewer for Bootstrap 4
Simple breakpoint viewer for Bootstrap 4
Just a convenient multi-colored block to assist while performing your layouts.
Bootstrap 4
Creating a modal window with HTML5 & CSS3
Creating a modal window with HTML5 & CSS3
Modal boxes are a frequently utilized tool in the web developer’s arsenal. Used for, amongst many things, login/register forms; advertisements; or just notifications to the user.
However despite the fact that modal windows frequently contain mission critical information, they are routinely created with JavaScript, which does not sit well with the best-practices of progressive enhancement or graceful degration.
This doesn’t need to be a problem, because HTML5 & CSS3 allow us to create modal windows with ease.
What we are going to do is use CSS3’s transition, opacity, pointer-event, and background gradient properties to create a very beautiful and functional modal box.
CSS • HTML • Lotus Formula
Sort the div in alphabetical order using data attribute
Sort the div in alphabetical order using data attribute
JavaScript • JQuery
Deferring images without lazy loading or jQuery
Deferring images without lazy loading or jQuery
HTML • JavaScript
Using Multiple JavaScript Onload Functions
Using Multiple JavaScript Onload Functions
Unfortunately, you cannot place multiple onload events on a single page. You can nest multiple functions within the one onload call, but what if you need to cascade an onload script across multiple pages, some which may already have an existing onload event? use the addLoadEvent function below.
JavaScript
Calculate time difference crossing midnight
Calculate time difference crossing midnight
This formula will help you calculate the hours difference between two times, even when the end time crosses midnight (Ex 7pm - 2am)
Excel
A true @Unique
A true @Unique
@Unique is case-sensitive, so "pear" and "Pear" and "PEAR" in a list will remain as three separate values. The formula below will truly return one value "Pear".
Lotus Formula
Forcing immediate indexes to actually update immediately
Forcing immediate indexes to actually update immediately
Have you found that your database's full-text index doesn't update immediately when you save a document, even when the frequency setting is set to "IMMEDIATE"?
The UPDATE function on the server checks the queue every 5 seconds for new task requests, however it uses the "Update Suppression Time" setting to wait until multiple, similar requests get deposited in the queue before it runs. This can take up to 15 minutes to execute.
Decreasing the suppression time interval on the server isn't a good solution since it will exponentially increase the load on the server's resources. And it still doesn't solve your problem because even a minute delay could frustrate a web user when their new document doesn't show up in search. So instead, the solution below will fire off the UPDALL routine directly in the server console for the specific database.
Print the java version in your IBM Domino server
Print the java version in your IBM Domino server
Java
Reserved fields for Lotus Domino web applications
Reserved fields for Lotus Domino web applications
There are several reserved fields available.
Lotus Notes Form
Force Ejecting a Disk - Mac
Force Ejecting a Disk - Mac
In the event that a disk has become stuck in your Apple computer, there are several steps you can take to try to force it to eject.
Mac
Stack of Paper
Stack of Paper
Simple, clean effect that works everywhere.
CSS • HTML
When "e.rowData" returns "undefined" in Android
When "e.rowData" returns "undefined" in Android
Appcelerator • Appcelerator Alloy
Convert a string from ISO-8859-1 to UTF-8
Convert a string from ISO-8859-1 to UTF-8
Use this handy LotusScript function to convert a string from ISO-8859-1 to UFT-8.
Appcelerator • Appcelerator Alloy • LotusScript • XML
Google Translate API Ajax via JavaScript
Google Translate API Ajax via JavaScript
You can perform specific word/sentence lookups against Google Translate via the AJAX the function below.
JavaScript
Force the simulator to use a specific language when performing a test run of your app.
Force the simulator to use a specific language when performing a test run of your app.
You can override the i18n 639-1 locale code so you can test your international apps.
Appcelerator Alloy
How to Solve Dropbox Problems Syncing
How to Solve Dropbox Problems Syncing
This problem was caused by a conflict in Dropbox’s cache. Because a file with the same basic name and properties already existed, Dropbox wasn’t able to create the new file on our end. This isn’t always a problem, but it can be if the sun and moon are aligned in a certain way.
Either way, you can solve these issues almost every time by clearing Dropbox’s hidden cache folder. This folder holds gigabytes of miscellaneous data collected during file downloads and sync processes in a series of smaller files with crazy alphanumeric names. This folder should reset itself every three days, though in cases where your Dropbox application is experiencing a conflict, you may not want to wait for the problem to resolve itself.
Linux • Mac • Windows
How to show hidden files and folders in Mac OS X Finder
How to show hidden files and folders in Mac OS X Finder
How to reveal secret hidden files on the Mac OS X desktop: this Mac Finder trick displays hidden files and folders.
Mac
CSS overflow: hidden not working when parent div width is state as % and not px
CSS overflow: hidden not working when parent div width is state as % and not px
You want to use the percent to control the width of td. In each td there is a div which has a 100% width relative to parent element td. If so, the overflow:hidden of div will no effective.
CSS • HTML
Set a cookie to expire in 1 hour
Set a cookie to expire in 1 hour
JavaScript
Extract just the postal code from Google Maps v3 api AutoComplete
Extract just the postal code from Google Maps v3 api AutoComplete
JavaScript
URL Escape and Unescape
URL Escape and Unescape
JavaScript contains a handy built-in function, 'escape', that encodes text so that it can appear as part of a URL. For instance, the space character is changed to %20, ampersand to %3B, and so on. The 'unescape' function converts these "percent" codes back to their original representation.
These are helpful functions to have available when you write Domino agents. These agents could use unescape to read arguments from their own URLs, and use escape when they need to print a new URL when they finish execution.
LotusScript
Convert a 24-hour time to a 12-hour time
Convert a 24-hour time to a 12-hour time
Converts 24-hour time to 12-hour time with an AM or PM designation.
JavaScript