The max length of an email, apparently, is 254.
Reference here: http://stackoverflow.com/questions/386294/what-is-the-maximum-length-of-a-valid-email-address
My online tech scrapbook where I keep my notes in case I need to look them up later
Saturday, January 4, 2014
Friday, January 3, 2014
Designing Validation Rules for Names
Seems like there's no hope of ever getting it right: http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
But still, I'm sure for the sanity of the app and where applicable, other users, certain rules can/should be applied on a case-by-case basis:
But still, I'm sure for the sanity of the app and where applicable, other users, certain rules can/should be applied on a case-by-case basis:
- Length limits because you simply can't design a website with any length of name possible
- Character limits in situations where names have to be readable by majority of users (e.g. restrict to ASCII or extended ASCII)
Monday, December 30, 2013
Changing Default Wordpress URL in Bitnami Wordpress AMI
Bitnami provides an AMI that can be used in the EC2 for quickly setting up a Wordpress server.
Steps described here: http://wiki.bitnami.com/Applications/BitNami_Wordpress_Stack#How_to_change_the_default_URL_to_root.3f
Steps described here: http://wiki.bitnami.com/Applications/BitNami_Wordpress_Stack#How_to_change_the_default_URL_to_root.3f
Saturday, December 21, 2013
Modal Window Not Displaying With AngularJS and Bootstrap
This will probably be fixed pretty soon but for now (i.e. Angular UI for Bootstrap version 0.7 and Bootstrap 3), the modal window will not display (only the backdrop will).
To make the modal window display, change "display: none" to "display: block" in the ".modal" class in the CSS. However, it will be very badly formatted. To fix the formatting issues, the markup for the modal needs to be put inside the following 2 div blocks:
References:
To make the modal window display, change "display: none" to "display: block" in the ".modal" class in the CSS. However, it will be very badly formatted. To fix the formatting issues, the markup for the modal needs to be put inside the following 2 div blocks:
<div class="modal-dialog">
<div class="modal-content">
<!-- modal content here→
</div>
</div>
|
References:
AngularJS Logging
AngularJS has a logging service $log that can be used to log information for e.g. debugging purpose. The main advantage of using this instead of the usual "console.log" is that you can control whether debug level messages are filtered out. Additionally, you can also add decorators to add additional behaviours.
To use it, just inject "$log" as you would $scope, $location etc.
Example here: http://docs.angularjs.org/api/ng.$log
Configure the $logProvider when defining the module to enable/disable debug.
Example: http://plnkr.co/edit/HZCAoS?p=preview
Example of decorator to add additional behaviour: https://coderwall.com/p/_zporq
To use it, just inject "$log" as you would $scope, $location etc.
Example here: http://docs.angularjs.org/api/ng.$log
Configure the $logProvider when defining the module to enable/disable debug.
Example: http://plnkr.co/edit/HZCAoS?p=preview
Example of decorator to add additional behaviour: https://coderwall.com/p/_zporq
Downloading File using curl
When you issue a "curl <url>" command, the output will be shown on stdout. This is great when trying to read a text response but most of the time, what you're doing is downloading a file.
The easiest way to do it is "curl -O <url>". This downloads the file with the same filename as the remote file.
The easiest way to do it is "curl -O <url>". This downloads the file with the same filename as the remote file.
Wednesday, December 18, 2013
CIDR Block Cheat Sheet
This page has a cheat sheet for coming up with CIDR blocks using the "a.b.c.d/x" notation: http://whatismyipaddress.com/cidr
Thursday, December 12, 2013
Online Tool for Converting Between Sexagesimal and Decimal Notations
Latitude and Longitude are represented sometimes in decimal notation and other times in sexagesimal notations.
Here's an online tool for converting between the two: http://ghiorzi.org/sexagesi.htm
Here's an online tool for converting between the two: http://ghiorzi.org/sexagesi.htm
Wednesday, December 11, 2013
Friday, November 29, 2013
Javascript Adding Arrays
To add a Javascript array to another, use the "concat" method. Note that it doesn't change the original array but instead returns a new one, so you have to assign the return value.
References:
References:
Friday, November 22, 2013
AngularJS Datepicker
The Angular UI team has an implementation based on JQuery UI datepicker. Download and documentation here: https://github.com/angular-ui/ui-date
Note: it is possible to customize the behavior using options (see "Options" section in the link above).
As an alternative, there is a variant based on Bootstrap: http://angular-ui.github.io/bootstrap/
Note: it is possible to customize the behavior using options (see "Options" section in the link above).
As an alternative, there is a variant based on Bootstrap: http://angular-ui.github.io/bootstrap/
Thursday, November 21, 2013
Does Order of Javascript Matter?
Yes, you should link dependencies first before linking the files that depend on the dependencies.
Reference: http://stackoverflow.com/questions/1323196/does-the-order-of-javascript-matter-in-a-page
Reference: http://stackoverflow.com/questions/1323196/does-the-order-of-javascript-matter-in-a-page
Wednesday, November 20, 2013
Sniffing Packets Using "tcpdump" on Mac OS
Here's how it's done: http://stackoverflow.com/questions/9321853/how-to-sniff-packets-on-mac-os-10-7-lion
Monday, November 18, 2013
Startup Funding Rounds
A good reference for anyone who might forget the names and numbers from time to time: http://www.mediapost.com/publications/article/199103/the-three-stages-of-funding-a-startup.html
Thursday, November 14, 2013
Git Diff Tool
It seems after the Mountain Lion update, "git difftool" now no longer has a graphical diff interface.
I had to set it up again using the instructions from here: http://git-scm.com/book/en/Customizing-Git-Git-Configuration
I also had to install kdiff3 separately.
I had to set it up again using the instructions from here: http://git-scm.com/book/en/Customizing-Git-Git-Configuration
I also had to install kdiff3 separately.
Wednesday, November 13, 2013
Jackson Date Handling
The default is behavior is epoch, but lots of way to customize, as explained here: http://wiki.fasterxml.com/JacksonFAQDateHandling
Servlet "init" Method Called Multiple Times
This can happen if an exception is thrown the last time it was called.
Monday, November 11, 2013
Thursday, November 7, 2013
Installing MongoDB Using "yum" in RedHat Based Distros
All it takes is to add the repository to the configuration.
Details here: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/
Details here: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/
Wednesday, November 6, 2013
AWS Policy Document "Sid" Field
This is a field that is usually generated by the policy generator but what happens when you copy and paste a policy? Is it safe to leave it unchanged? Or should it be changed to another value?
According to this blog post:
"The Sid (statement ID) is an optional identifier you provide for the policy statement. Essentially it is just a sub-ID of the policy document's ID. The Amazon S3 implementation of the access policy language require this element and have uniqueness requirements for it."
In this case, any identifier unique to the document should be sufficient, even "1", "2", "3" etc.
According to this blog post:
"The Sid (statement ID) is an optional identifier you provide for the policy statement. Essentially it is just a sub-ID of the policy document's ID. The Amazon S3 implementation of the access policy language require this element and have uniqueness requirements for it."
In this case, any identifier unique to the document should be sufficient, even "1", "2", "3" etc.
Subscribe to:
Posts (Atom)