# SMTP gmail on Codeigniter 3

Use the following code

And dont froget to unable following two security settings in google.

1) https://www.google.com/settings/security/lesssecureapps << turn it on

** Turn off 2 step verification if you have it enabled.

Code :

$config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.gmail.com', 'smtp_port' => 465, 'smtp_user' => 'dkumara85@gmail.com', //email id 'smtp_pass' => 'xxxxxxxxxxx', // password 'mailtype' => 'html', 'charset' => 'iso-8859-1' );$this->load->library('email', $config);$this->email->set_newline("\r\n");

$this->email->from('dkumara85@gmail.com','my name');$this->email->to("dkumara85@gmail.com"); // email array
$this->email->subject('email subject');$this->email->message("my mail body");

$result =$this->email->send();

show_error(\$this->email->print_debugger());  // for debugging purpose :: remove this once it works...

I reblogged this tips from howtogeek.com

The other day we wrote up how to compress a folder of images using a single line from the bash shell prompt, which is native to Linux but works on Windows if you install Cygwin. Naturally there’s a simpler solution for Windows users, and reader Lee Thompson wrote in to share it with you all.

First, you’ll need to install ImageMagick for Windows and make sure that it is in your system path.

Then, create a new batch file in Notepad with a clever name like compressall.bat, and paste in the following lines of code. Note that you can adjust the *.jpg to something else if you want to include PNG files as well.

@echo off for %%f IN (*.jpg) DO convert -quality 70 "%%f" "%%f"

Save that batch file somewhere in your system path (you could stick it into C:\Windows if you really wanted to, but it would be better to create a scripts folder and add that to your system path). Then all you have to do is navigate to a folder in your command prompt, and run the batch file by typing compressall at the prompt.

But we can make this even better.

We also recently showed you a stupid geek trick where you can run commands in the Windows Explorer address bar, or open a command prompt already keyed to that folder. And now, finally, we have a great use case for that trick.

Once you’ve saved the compressall batch file into the system path, you can use it wherever you want. Just open up any folder of images in Windows Explorer, and then type compressall into the address bar.

You’ll see a command prompt window flash up and quickly disappear once it is finished. And all your images will be a smaller file size.

If you wanted to get really fancy, you could modify the batch file to create a backup directory, copy all of the images in there, and then proceed with the compression.  That way you’d have an automatic backup before compressing images.

Again, thanks to reader Lee Thompson for this great tip!

# Javascript to handle error / broken images

Big thanks to Prestaul and Ryan O’Hara for the anwers.

This solution to handle error / broken images is working like a charm 🙂

Handle the onError event for the image to reassign its source using JavaScript:

function imgError(image) {
image.onerror = "";
image.src = "/images/noimage.gif";
return true;
}
<img src="image.png" onerror="imgError(this);"/>

Or without a JavaScript function:

<img src="image.png" onError="this.onerror=null;this.src='/images/noimage.gif';" />

The following compatibility table lists the browsers that support the error facility:

http://www.quirksmode.org/dom/events/error.html

I use the direct solution without using javascript, it works well especially on lazy load image

# Open File .h .m from Notepad++

Today, I want to open .h and .m file extension, those are Objective-C file, formerly can only be opened from xcode. I believe that notepad++ can do this..:D, From this source I got this information (written below), thank you so much for your useful Info, now I can open .h and .m file from notepad++ :happy:

========================================

Notepad++ doesn’t list .h, .m and .mm files as Objective-C files (.mm is Objective-C++) by default for some reason.

You can modify your langs.xml file to tell Notepad++ to associate those extensions with Objective-C. Open the file %AppData%\Notepad++\langs.xml, and scroll down to the following area:

<Language name="objc" ext="" commentLine="//" commentStart="/*" commentEnd="*/">
<Keywords name="instre1">if else switch case default break goto return for while do continue typedef sizeof NULL self super nil NIL</Keywords>
<Keywords name="instre2">interface implementation protocol end private protected public class selector encode defs</Keywords>
<Keywords name="type1">void struct union enum char short int long double float signed unsigned const static extern auto register volatile id Class SEL IMP BOOL</Keywords>
<Keywords name="type2">oneway in out inout bycopy byref</Keywords>
</Language>

Then add h m mm to the ext attribute:

<Language name="objc" ext="h m mm" commentLine="//" commentStart="/*" commentEnd="*/">
<Keywords name="instre1">if else switch case default break goto return for while do continue typedef sizeof NULL self super nil NIL</Keywords>
<Keywords name="instre2">interface implementation protocol end private protected public class selector encode defs</Keywords>
<Keywords name="type1">void struct union enum char short int long double float signed unsigned const static extern auto register volatile id Class SEL IMP BOOL</Keywords>
<Keywords name="type2">oneway in out inout bycopy byref</Keywords>
</Language>

If editing the langs.xml file in your %AppData%\Notepad++ folder doesn’t work, you’ll have to open the one in %ProgramFiles%\Notepad++ instead. Make sure to back up the original in case you mess up somewhere.

This is some version of windows? If so you right click the file, select Open With, and in the subsequent dialog, you can select or browse for Notepad++ and ensure the checkbox that says something like “always use this program to open these files” (not sure of exact wording and I’m not on a windows box now).

# 2014 in review

The WordPress.com stats helper monkeys prepared a 2014 annual report for this blog.

Here’s an excerpt:

A San Francisco cable car holds 60 people. This blog was viewed about 1,500 times in 2014. If it were a cable car, it would take about 25 trips to carry that many people.

# 8 Easy Steps to Becoming a Data Scientist

OK, the steps are not that easy. They are all doable, and most of the steps are free or very low-cost. They will just take some time.

Thanks to the fine folks at DataCamp, creator of online data science courses, for the infographic.

Source: blog.datacamp.com

View original post

# Korean Hangeul in Latex

I am looking for the tutorial or tips on how to write Korean character (hangeul) in Latex. Most of them mention about using CJK package, however I had a lot of problem and error to get CJK package to work, so i found the tutorial from this source, and try it on my Latex Project.

The package name called “kotex”

\documentclass{article}
\usepackage{kotex}
\begin{document}
안녕하세요!
\end{document}

Output

안녕하세요!

In the tutorial, the writer said that :

The good part about this was I was able to simply copy and paste hangeul from websites into the LaTeX document and it worked fine. I only wanted a few words (my name) as well, so this option might be quicker and easier.