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


Share:

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 my development.   I don't want to use any cloud database like AWS MySQL or Google cloud db, because it's a paid one and apparently I'm not online always.   Things like I can work even in train (really hardworking right?) wherein internet is superslow.

Now comes SQLite.   SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file.  Meaning a portable database which will solve my dillema.


To use SQLite on Laravel

Create a database laravel.sqlite file in the database folder of your laravel project.   You might need to download SQLite browser in http://sqlitebrowser.org/

/your-project/database/laravel.sqlite



Open your database.php file in the config folder of your project and make sure what you see in the image below is the same in your project.






Go to your .env file and and change your DB_CONNECTION to
'sqlite'. Another thing you have to do is change DB_DATABASE to the path of your laravel.sqlite on your local computer.  You can leave the port, username and password.



Share:

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 file. If you install Laravel via Composer, this
file will automatically be renamed to .env. Otherwise, you should rename the
file manually.

Your .env file should not be committed to your application's source control,
since each developer / server using your application could require a different
environment configuration. Furthermore, this would be a security risk in the event
an intruder gain access to your source control repository, since any sensitive
credentials would get exposed.

If you are developing with a team, you may wish to continue including a .env.example
file with your application. By putting place-holder values in the example configuration
file, other developers on your team can clearly see which environment variables are
needed to run your application. You may also create a .env.testing file. This file will
override values from the .env file when running PHPUnit tests or executing Artisan commands
with the --env=testing option.

To add paypal or stripe you can check Laravel eCommerce with Paypal and Stripe Payment
Share:

Friday, 3 November 2017

Solr Sample Code and Articles

https://lucene.apache.org/solr/4_0_0/tutorial.html
https://github.com/pkainulainen/spring-data-solr-examples
https://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.html
https://github.com/paramsethi/solr-setup
http://cmusphinx.sourceforge.net/2012/06/building-a-java-application-with-apache-nutch-and-solr/
http://www.solrtutorial.com/solrj-tutorial.html
https://www.drupal.org/node/484800
https://www.codeenigma.com/host/faq/how-do-i-create-solr-core-my-server
Share:

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 To make the postmark use environment variables please follow this steps Comment out the default "from:" in ApplicationMailer To create an environment variable and add this line in your secrets.yml in your application.rb add this lines
Share:

Thursday, 2 March 2017

Traverse in all files in directory using Java

Using apache collection to traverse all files in directory with regex
Share:

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
Share:

Popular Posts

Recent Posts

Pages

Powered by Blogger.