I don't trust my memory well so I'll document some migrations command
php artisan make:migration add_paid_to_users --table="users"
This line will create a book table migrations
php artisan make:migration create_books_table --create="books"
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBooksTable...
Saturday, 25 November 2017
Wednesday, 8 November 2017
How to get the URL of the current page in C#
Lot of times I checked the URL for doing coding. To get all the possible values put these codes
![CDATA[
Response.Write("HttpContext.Current.Request.Url.Host " + HttpContext.Current.Request.Url.Host + "");
Response.Write("HttpContext.Current.Request.Url.Authority " + HttpContext.Current.Request.Url.Authority+ "");
Response.Write("HttpContext.Current.Request.Url.Port " + HttpContext.Current.Request.Url.Port+...
Monday, 6 November 2017
Using SQLite in Laravel Applications
I have been playing with Laravel and MySQL just recently and I have been enjoying using it on one of my recent project. It's an eCommerce system done with Laravel 5.3 with Paypal and Stripe Payment. I have implemented a authorize and capture mechanism. I've been using MySQL for database which works as expected but my problem is I'm using 3 machines for...
Sunday, 5 November 2017
Laravel Default Env File Content
It is often helpful to have different configuration values based on
the environment where the application is running. For example, you
may wish to use a different cache driver locally than you do on your
production server.
To make this a cinch, Laravel utilizes the DotEnv PHP library by Vance
Lucas. In a fresh Laravel installation, the root directory of your application
will contain a .env.example...
Friday, 3 November 2017
Solr Sample Code and Articles
https://lucene.apache.org/solr/4_0_0/tutorial.htmlhttps://github.com/pkainulainen/spring-data-solr-exampleshttps://www.petrikainulainen.net/programming/solr/spring-data-solr-tutorial-configuration/http://nerdcenter.de/solr-multicore-installation-configuration/http://www.params.me/2012/11/sample-solr-14-application-code-in-java.htmlhttps://github.com/paramsethi/solr-setuphttp://cmusphinx.sourcefor...
Monday, 11 September 2017
Sending Responsive Email Template using Rails and Postmark
Sending a responsive email template and
Need to watch https://www.driftingruby.com/episodes/mail-previews-and-templates
Get some template here http://foundation.zurb.com/emails/email-templates.html
add this in your gem file
gem 'premailer-rails'
gem 'postmark-rails', '~> 0.15.0'
To make the postmark use environment variables please follow this steps
Comment out the default "from:"...
Thursday, 2 March 2017
Traverse in all files in directory using Java
Using apache collection to traverse all files in directory with regex
![CDATA[
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.DirectoryFileFilter;
import org.apache.commons.io.filefilter.RegexFileFilter;
public...
Wednesday, 22 February 2017
Java Enumeration Good Example
Enums are lists of constants. When you need a predefined list of values which do represent some kind of numeric or textual data, you should use an enum.
You could enter number or string to get the specific value
...
Javascript Example To Call an Ajax
Example code in javascript to call an ajax
function changeDeliveryTime() {
var deliveryMethod = $('#deliveryMethod').val();
var delAddress = $('#delAddress').val();
var schedule = $('#scheduleko').val();
$.ajax({
type : "GET",
url : "/ajaxchangedeliveryschedule.do?deliveryMethod=" + deliveryMethod + "&address=" + delAddress + "&scheduleId=" + schedule,
success...
Miscellaneous useful sites
JSON FORMATTER
Online Date Formatter for Java
Angular
Maven Repository
Some Angular Tutorials
Regex Tester
Another Good Regex Tester
Cron Tab Maker
Cron Tab Maker Based on Quartz (java)...
JQuery set maximum date on date input.
This entry will set the max date to 13yrs and below
normally use for registration for above 13yrs old only
http://stackoverflow.com/questions/16232594/datepicker-set-date-during-page-load
![CDATA[
$(document).ready(function() {
$('#date-input').datepicker({
}).datepicker( "option", {
setDate:"0",
maxDate:'-13y -1d'
}...
Setting and Getting Session Storage Sample Code
Alternative to hidden input type,
var isWeekly = sessionStorage.getItem("weeklyOrder");
sessionStorage.setItem("weeklyOrder", true);...
Some Interview Question
What was your bigger achievement?
"I have several notable accomplishments in my career. Probably the most notable accomplishment was the delivery of the most recent version update to one of our core products for customer payments. This was a 12-month project and I was one of 8 team members. What made it notable for me was that my role expanded from being one of the tech team members to taking the...
Different Ways To Read A Text File in Java
There's a lot of way to read a text file in java and listed below are some methods I used....
How to declare a new exception in Java
Sample java code to declare a new exception.
public class MyNewException extends Exception {
private static final long serialVersionUID = -7994546786269588726L;
public MyNewException() {
super();
}
public MyNewException(String msg) {
super(msg);
}
...
Display and Change Date in Ubuntu Terminal
I have this requirements before to run a batch job every day and check the generated records.
Of course you don't wait for tomorrows outcome so sometimes we need to age the pc or system date.
...