• Home
Fedrianto Ramadhan Learning all I can

Using Image Moo making thumbnails with watermarks and sizes

14/06/2013 2:01 pm / Leave a Comment / madindo

I know there’s a lot of resizing method out there but this image moo I love it… But the way it’s processing the image is to damn slow. Friend of mine said that he tryed using this for bulk image it’s just too slow… but if can install in our server it’ll be easier but in here I don’t want to install stuff because most of my clients are on shared hosting which I can install anything in it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$this->load->library('upload');
$this->load->library('image_moo');
$config['upload_path'] = FCPATH.'uploads/images/sell/';
$config['allowed_types'] = 'gif|jpg|png';
$config['remove_spaces'] = TRUE;
$this->upload->initialize($config);
$fonts = FCPATH.'assets/home/font/arial.ttf';
if (!empty($post))
{
$size_images = array('low','medium','large');
foreach ($size_images as $size_image)
{
if (!empty($_FILES['file_'.$size_image])){
if($this->upload->do_upload('file_'.$size_image)){
$results = $this->upload->data();
$uploaded_image = FCPATH.'uploads/images/sell/'.$results['file_name'];
$sizes = array(120,230,500);
$fontsize = 0;
foreach ($sizes as $size)
{
if ($size == 120)
$fontsize = 5;
elseif ($size == 230)
$fontsize = 9;
elseif ($size == 500)
$fontsize = 20;

$thumb = str_replace('.', '_'.$size.'_'.$size.'.', $results['file_name']);
$imageFile = FCPATH .'uploads/thumbs/sell/'.$thumb;
$this->image_moo->load($uploaded_image)->make_watermark_text("fedrianto.com",$fonts,$fontsize,'#fff')->resize($size,$size,TRUE)->watermark(5)->save($imageFile,TRUE);
}
}
}
}
}
Posted in: Development / Tagged: codeigniter, image moo

Android Phone not mounting

12/06/2013 10:58 am / Leave a Comment / madindo

I have a brand new laptop I got from work then I tried to mount it on my new laptop, usually there would be a notification which I can use to mount. Somehow now it doesn’t…

I knew where which menu but because I had it in Indonesian somehow I’m not familliar on the menu because it just sounds not right.

Just to remind myself this is how you do it : unplug the cable go to Settings->Wireless and network->USB utilities then plug it again.

Posted in: Info / Tagged: android

Starting Moodle and create own theme

11/06/2013 4:33 pm / Leave a Comment / madindo

Download the file from the moodle site

Just follow the step and if there’s missing in the requirement just set php.ini or other config that needs to be updated.

I thought it would be easy just copy and paste the theme folder but it’s not that… read the documentation Creating_a_theme somehow I don’t really like to read throughout. I did the copy and paste but ain’t working then found this on moodle FAQ

  1. Copy folder theme/standard and call it theme/new
  2. In theme/new/lang/en folder,
  3. Renamed theme_standard.php to theme_new.php
  4. Opened theme/new/lang/en/new.php, recommend you change 2 lines to read something like: $string['pluginname'] = ‘New theme – Martin D’; $string['chooseredme'] = ‘New theme came from the Standard theme and is being changed by Martin D in 2011′; Saved the file
  5. In theme/new/config.php - Change $THEME->NAME = ‘new’;
  6. Went to Administration > Site Administration >Appearance > Theme settings > Theme designer mode (Checked)
  7. Settings > Site Administration >Appearance > Theme selector
  8. Clear theme caches
  9. Select theme

After trying the steps above somehow it still doesn’t show in selecting theme, you know what it’s because of the cache… I tried reset cache but not working again. So i thought of how to clear cache the hard way maybe delete somefiles or something but then do this Site administration – development – purge all caches

Then my new theme is showing yay

Posted in: Development / Tagged: moodle

How to create PPK for git / svn

11/06/2013 1:28 pm / Leave a Comment / madindo

Goto Cpanel
Goto SSH/shell access
generate key and download private key
I use RSA2 1024 bit because it’s the same as puttygen so later just choose the middle one

download Puttygen
click load the key (if not shown select file type to all)
select RSA2 1024bit
then save private key

Troubleshooting – made a mistake on adding username… I thought the username was the username that I created but actually it’s not… it’s your cpanel account username then after adding the key then you add the username that was created

Posted in: Development / Tagged: ssh

Array PHP To CSV with Sanitizing arrays

17/05/2013 7:41 pm / Leave a Comment / madindo

Found this somewhere I forgot, what this do is when you have bunch of arrays but when a quotes or something else that will mess up the writing to csv, this is the best I could find so far.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function array_to_scv($array, $header_row = true, $col_sep = ",", $row_sep = "\n", $qut = '"')
    {
        $output = '';
    	if (!is_array($array) or !is_array($array[0])) return false;
    	
    	//Header row.
    	if ($header_row)
    	{
    		foreach ($array[0] as $key => $val)
    		{
    			//Escaping quotes.
    			$key = str_replace($qut, "$qut$qut", $key);
    			$output .= "$col_sep$qut$key$qut";
    		}
    		$output = substr($output, 1)."\n";
    	}
        
    	//Data rows.
    	foreach ($array as $key => $val)
    	{
    		$tmp = '';
    		foreach ($val as $cell_key => $cell_val)
    		{
    			//Escaping quotes.
    			$cell_val = str_replace($qut, "$qut$qut", $cell_val);
    			$tmp .= "$col_sep$qut$cell_val$qut";
    		}
    		$output .= substr($tmp, 1).$row_sep;
    	}
    	
    	return $output;
    }
Posted in: Development

O2danceschool Membership System

06/05/2013 5:48 pm / Leave a Comment / madindo
O2dance Membership_640x396

Position : Freelancer

Tools :  CI, Jquery, Mysql

Live : o2dancemembership.madindo.com

Description : O2danceschool Membership system for a friend of mine

Posted in: Portfolio

Natanashoes.com

06/05/2013 4:24 pm / Leave a Comment / madindo
Natanashoes_640x388

Position : Freelancer

Tools :  CI, Jquery, Mysql

Live : www.natanashoes.com

Description : New ecommerce for women’s shoes

Posted in: Portfolio

Anathassa first birthday

05/04/2013 7:52 am / Leave a Comment / madindo
At 12/10/2012 was my baby’s birthday, we prepared catering, tumpengan  and the birthday cake got it from somewhere in the front of the hospital pertamina. Family & friends came it was fun and hopefully for Tacca as well but for me there was something that I really regret… I didn’t knew how to photograph and can’t speak in public like my father in law… uses my friend’s nikon, it was awesome when you hold it but somehow the result is saddening. I can’t blame anyone but me… No good pictures to remember it was all blurry, I regret next time have to be prepared but next we thought of going for donation for yatim piatu. My friend created this slideshow of us which is nice of him… Thank you
Read More →
Posted in: Personal

[Exploring] Sari Ater Hotel and Resort

03/04/2013 4:41 am / Leave a Comment / madindo

This slideshow requires JavaScript.

Me and my family went out to find a new to find a new place to go then we found out on the web that there was a hot spring in sari ater in bandung and next to it there’s a park where we could walk… It was really nice for a change, we took a horse ride with the guide I thought it was only a few thousands but they charge around 200 thousand rupiah for both horses because we took a long ride, but really it was long, if I was the guide I wouldn’t been able to walk that far. When we walked around there was also a racing karts and so on, I include a video of us horse riding :)

Posted in: Personal

[Exploring] Swimming at Panglima Polim

28/03/2013 6:00 am / Leave a Comment / madindo
Here are the location of the swimming pool that me and my family went to… Googlemap. I didn’t know that there was a swimming pool in this area, it’s just perfect so close to home… But in there it’s kind of crowded and closes at 14:30 sad can’t go there in the afternoon when it’s not hot. Tacca is trying her new swimming outfit, so cute :) and here’s the video of me and Tacca Swimming… Now she can stand on the water, Awesome.

After that we went to PIM so Tacca can eat first before going to the alternative medical in Bintaro called Chicken Alternative (berobat dengan ayam). At the PIM there was some playground for kids but not suitable for Tacca but the counter said that there’s a playground for baby 0 – 2 years old, so I went there and it was perfect for Tacca, she couldn’t stay still and want to try everything. The price was 40rb / 30 minutes (sucks) but worth it :) and had to buy socks for both of us. I recorded Tacca but unfortunately low on storage damn…

Posted in: Personal

Post Navigation

1 2 3 … 13 Next »


Categories

  • Book Notes
  • Development
  • Experiences
  • Info
  • Personal
  • Portfolio
  • Religion

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1 other subscriber

© Copyright 2013 - Fedrianto Ramadhan
Infinity Theme by DesignCoral / WordPress