2010
08.23

Recently I had to set up a system that would post a job offer to monster.com web service using SOAP.

Once I made the script to generate the XML I started looking into the SOAP class that PHP5 provides but I soon started to feel the headache comming !

So I justed wanted to help out If some of you were facing the same issue : FORGET that soap class and use a basic CURL !

Here is my code snippet

$headers=array("Accept: text/xml","Content-Type: text/xml");
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,"https://208.71.198.74:8443/bgwBroker");
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $xml); // your soap xml that you generated earlier
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
$return = curl_exec($curl);
curl_close ($curl);

And there you go ! you just have to handle the return info.

I hope that this will help someone one day !

  • Share/Bookmark

Related Posts:

2010
07.27

Today I had to make a simple script that changed the class of an element when you “right clicked” on it but I struggled for hours trying to disable the right click contect menu from showing.

Finally I found a simple solution so I decided to share :)

I tested it on FF 3.6 & IE7

the magical line is

$(el)[0].oncontextmenu = function() {
			return false;
		}

For a concrete example here is my code

$(".besoin").bind('mousedown',function(event){
		switch (event.which) {
	        case 3:
			        if($(this).hasClass("mild")){
						$(this).removeClass("mild");
						$(this).addClass("hot");
					} else if($(this).hasClass("hot")){
						$(this).removeClass("hot");
						$(this).addClass("superhot");
					} else if($(this).hasClass("superhot")){
						$(this).removeClass("superhot");
					} else {
						$(this).addClass("mild");
					}
	        break;
		}
		$(this)[0].oncontextmenu = function() {
			return false;
		}
	});

Have fun !

  • Share/Bookmark

Related Posts:

2009
10.31

There is a lot of info on the net on how to install ubuntu on a pendrive but when I had to do it I found that it was not that clear

So I decided to describe my easy method here to have a persistent ubuntu on a usb pendrive.

Maybe my method is not the best but It’s the easiest way I found to do it.

note : You will need at least a 4GB drive to do this.

Read More >>

  • Share/Bookmark

Related Posts:

2009
10.30

Hello everyone,

I had to install anyterm on a fresh karmic koala yesterday but i’ve ran into so many problems that I decided I’ll write a simple tutorial about this subject.

Anyterm is a software that allows you to acces a terminal over http(s) protocol, so it allows you to bypass most proxys.

For more info on anyterm please visit the official website at http://anyterm.org/

This tutorial will explain how to compile from the SVN source 1.1.29 but may be slightly diferent if you are trying to use another version.

Read More >>

  • Share/Bookmark

Related Posts:

2009
10.07

Today I had to make a function for a client of mine so I decided to share it with you.

It’s a oneliner but can add a really nice effect to your website.

This function needs jQuery

function goToByScroll(id){
     	$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
}

Of course you can change slow to normal or fast or even a int in milliseconds.

And to call it

<script>
goToByScroll("theIdIWantToGoTo");
</script>

Enjoy

  • Share/Bookmark

Related Posts:

2009
09.29

Today,

I’ll just add a note to my previous post that showed you how to slide a div with a bit of Javascript.

Maybe some of you rather use a simpler way to do this and since my previous article got quite a lot of visits I decided to show you how !

Read More >>

  • Share/Bookmark

Related Posts:

2009
09.01

Today I want to show you how to make a image tagging function on your website.

It works about the same way than facebook does (or a least the way it worked some times ago because I deleted my facebook account)

Basicly you take an image and you “tag” people or stuff in it by marking what you want to tag with a rectangle.

This example is just a proof of concept and will give you a good idea on how to make it better for your website.

This script requires jquery and jquery-ui with draggable and resizable function(it’s included in the source).

note : I didnt have time to test it on IE so let me know if it works for you…

Here is the Demo and the Source.

Read More >>

  • Share/Bookmark

Related Posts:

2009
08.29

Even if you are the best web developper around , your work is not worth much if you dont have a killer design right ?

Of course you can make your own but I know many devs you arent made for designing ! (me included…)

A lot of websites offers templates that you can download for 50$ but with my experience they are almost always just referals for templateMonster.
TemplateMonster sometimes offers nice looking website but they so poorly coded that they are almost unusable !

So I just wanted to share with you some good alternatives…

Read More >>

  • Share/Bookmark

Related Posts:

2009
08.09

Hello all,

First let’s explain the basics of what we are trying to do.
We’ll build a script that will replace any type of url to a tiny url so it’s easier to post or be untraceable.

For example this *long* google maps url

http://maps.google.fr/maps?f=q&source=s_q&hl=fr&geocode=&q=white+house&sll=46.75984,1.738281&sspn=10.178118,28.54248&ie=UTF8&z=15&iwloc=A

could become

http://your.site/v/12345

you can check it out here : http://www.djpate.com/portfolio/shortURL/create.php

and download the source code here

This is not very hard to do but it’s nice tutorial for beginners.

Read More >>

  • Share/Bookmark

Related Posts:

2009
08.06

Hello,

I’ve just worked on something for a project of mine and I wanted to share this code with you.

It’s nothing new but good to know…

Read More >>

  • Share/Bookmark

Related Posts: