Jump to content
Sign in to follow this  
parker216

We Are In Need Of Any Code Snippets You May Feel Are Helpful!

Recommended Posts

Hello CP Members! We are in great need of any useful code snippets you may have.
Most Needed Are:

  • HTML (html4, html5, xml, css, javascript)
  • JAVA
  • PHP
  • C++, C#
  • Visual Basic (vb6, vb.net, etc)
  • Windows Script (Shell, Command Line)

Please feel free to add any of the above that you feel might be helpful to someone.
Remember, "Sharing Is Caring"!


Thanks To You All!!!!


:yourock:  :clap2:  :yourock:

  • Like 1

Share this post


Link to post
Share on other sites

@ vigneshnallamad, basically anything that you think someone might need in any program they are writing. we are not being picky here right now. once things start getting posted, people will give feed back of what they are looking for the most. thanks bro!!!!

 

Parker216

CW Tech Mod

_

  • Like 1

Share this post


Link to post
Share on other sites

here goes....

 

below im posting few clones of famous websites which are totally nulled and every script is available thr..

 

Google search engine clone script...

 

http://www.mediafire.com/download.php?vw2p2ww1q7frkgu

 

whatismyip.com clone

 

http://www.mediafire.com/download.php?y6nmr8c9x989um7

 

imageshack.us clone

 

http://www.mediafire.com/download.php?bs131rpgwdv4xgt

 

myspace.com clone

 

http://www.mediafire.com/download.php?xy9k3o93esd75oc

  • Like 3

Share this post


Link to post
Share on other sites

i have a gr8 code i used to use it from desktop to access any program quickly instead of going start menu--------->all program----->required program

Share this post


Link to post
Share on other sites

Cyberwarez33, by all means, please post your code snippet for us. Thank You!

Share this post


Link to post
Share on other sites

hey guys, we are still looking for code from anything you have that is useful. I will be posting a lot of command shell scripts that I wrote for my job as a Sys Admin. Hopefully, they will be helpful to someone who needs to do the same things I did. They mostly deal with server scripts and network info scripts. If any of you have anything...I mean, ANYTHING, please by all means feel free to post. THANKS!!!!

 

Parker216

CW Tech Mod

_

  • Like 2

Share this post


Link to post
Share on other sites

Take a JPG image, and convert it to ASCII code

 

 

<html>

<head>

<title>Ascii</title>

<style>

body{

line-height:1px;

font-size:1px;

}

</style>

</head>

<body>

<?php

function getext($filename) {

$pos = strrpos($filename,'.');

$str = substr($filename, $pos);

return $str;

}

$image = 'image.jpg';

$ext = getext($image);

if($ext == ".jpg"){

$img = ImageCreateFromJpeg($image);

}

else{

echo'Wrong File Type';

}

$width = imagesx($img);

$height = imagesy($img);

 

for($h=0;$h<$height;$h++){

for($w=0;$w<=$width;$w++){

$rgb = ImageColorAt($img, $w, $h);

$r = ($rgb >> 16) & 0xFF;

$g = ($rgb >> 8) & 0xFF;

$b = $rgb & 0xFF;

if($w == $width){

echo '<br>';

}else{

echo '<span style="color:rgb('.$r.','.$g.','.$b.');">#</span>';

}

}

}

?>

</body>

</html>

  • Like 2

Share this post


Link to post
Share on other sites

Get Real IP Address of Client

This function will fetch the real IP address of the user even if he is behind a proxy server.

 

 

function getRealIpAddr()

{

if (!emptyempty($_SERVER['HTTP_CLIENT_IP']))

{

$ip=$_SERVER['HTTP_CLIENT_IP'];

}

elseif (!emptyempty($_SERVER['HTTP_X_FORWARDED_FOR']))

//to check ip is pass from proxy

{

$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];

}

else

{

$ip=$_SERVER['REMOTE_ADDR'];

}

return $ip;

}

  • Like 2

Share this post


Link to post
Share on other sites

Want to display how many Facebook fans do you have, in full text, on your blog? It’s very easy using the following snippet:

 

 

 

function fb_fan_count($facebook_name){
   // Example: https://graph.facebook.com/digimantra
   $data = json_decode(file_get_contents("https://graph.facebook.com/".$facebook_name));
   echo $data->likes;
}

  • Like 2

Share this post


Link to post
Share on other sites

Get the OS version on your PC in C++

 

#include <windows.h>

#include <iostream>

#include <dos.h>

#include <string.h>

int main(void)

 

{

OSVERSIONINFO osver;

osver.dwOSVersionInfoSize = sizeof(osver);

if (GetVersionEx(&osver))

 

{

if (osver.dwPlatformId == VER_PLATFORM_WIN32s)

cout <<"Win32 ";

else if (osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)

 

{

if (osver.dwMinorVersion == 0 && (strchr(osver.szCSDVersion,'B') == NULL)

&& (strchr(osver.szCSDVersion,'C') == NULL))

cout <<"Windows 95 ";

else if (osver.dwMinorVersion == 0 && (strchr(osver.szCSDVersion,'B') != NULL))

cout <<"Windows 95 OSR 2 ";

else if (osver.dwMinorVersion == 0 && (strchr(osver.szCSDVersion,'C') != NULL))

cout <<"Windows 95 OSR 2.5 ";

else if (osver.dwMinorVersion == 10 && (strchr(osver.szCSDVersion,'A') == NULL))

cout <<"Windows 98 ";

else if (osver.dwMinorVersion == 10 && (strchr(osver.szCSDVersion,'A') != NULL))

cout <<"Windows 98 Second Edition ";

else if (osver.dwMinorVersion == 90)

cout <<"Windows Millenium Edition ";

else

cout<<"Unknown Windows ";

}

else if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT)

cout <<"Windows NT ";

cout <<osver.dwMajorVersion<<"."<<osver.dwMinorVersion<<"."

<<(osver.dwBuildNumber & 0xffff)<<osver.szCSDVersion<<endl;

}

else

 

 

{

cout <<"Cannot gain version information."<<endl;

}

system("pause");

return 0;

}

Share this post


Link to post
Share on other sites

Launch notepad using C++

 

#include <iostream.h>

#include <windows.h>

int main(void)

{

 

cout<<"Explorer will launch.\n"<<endl;

/*replace with the path to your explorer.exe*/

system("h:\\windows\\explorer.exe");

 

return 0;

}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×