Convert html code to image PNG, JPG

by in 0

You can use this code to convert html code into images.
Switch imagepng to imagegif, imagejpg as your purpose.



$html_code = "this is the body";


$my_img = imagecreate( 200, 80 );
$background = imagecolorallocate( $my_img, 0, 0, 255 );
$text_colour = imagecolorallocate( $my_img, 255, 255, 0 );
//$line_colour = imagecolorallocate( $my_img, 128, 255, 0 );
imagestring( $my_img, 4, 30, 25, "$html_code",$text_colour );
imagesetthickness ( $my_img, 5 );
imageline( $my_img, 30, 45, 165, 45, $line_colour );

header( "Content-type: image/png" );
imagepng( $my_img );
imagecolordeallocate( $line_color );
imagecolordeallocate( $text_color );
imagecolordeallocate( $background );
imagedestroy( $my_img );


Css to the children nodes based on the number of siblings they have

by 0

Some one ask me "how can style element based the number of children it has?"


in CSS3, styles cannot be applied to a parent node based on the number of children it has. However, styles can be applied to the children nodes based on the number of siblings they have.




/* one item */
li:first-child:nth-last-child(1) {
    width: 100%;
}

/* two items */
li:first-child:nth-last-child(2),
li:first-child:nth-last-child(2) ~ li {
    width: 50%;
}

/* three items */
li:first-child:nth-last-child(3),
li:first-child:nth-last-child(3) ~ li {
    width: 33.3333%;
}

/* four items */
li:first-child:nth-last-child(4),
li:first-child:nth-last-child(4) ~ li {
    width: 25%;
}

Create a phpFox module

by in , 0

This tutorial help you get the basic concept & knowledge about phpFox module structure and how it communicate with others.

module_3.png

Read more »

Patch fix for Replay in Live HTTP Headers

by in 2

Live HTTP Headers  is very useful addon for developer on firefox

But Replay option doesn't work in new FF! since September 2014

How to make "Replay" work again?
Easily, please following these steps

  1. Close firefox if it's opened
  2. Run : Type: %APPDATA%\Mozilla\Firefox\Profiles\ Enter
  3. CLick on extension folder, Ex: yourprofile.default\extensions\
  4. Search for "livehttpheaders.jar", then open the folder contained livehttpheaders.jar
  5. Download this patch: Patch fix Replay Live HTTP Headers 
  6. Uncompress the downloaded file into that folder
  7. Done.



How to disable updatedb? /usr/bin/updatedb

by in , 0

Sometimes you can see /usr/bin/updatedb running cause high load.
a question is posed. is It necessary to keep updatedb?

Just do the following step to find out the answer

  1. First find out where the program is located on disk.
    $ type updatedb
    updatedb is /usr/bin/updatedb
    
  2. Next find out what package provides updatedb.
    $ rpm -qf /usr/bin/updatedb
    mlocate-0.26-3.fc19.x86_64
    
  3. See if anything requires mlocate.
    $ rpm -q --whatrequires mlocate
    no package requires mlocate
    
  4. Nothing requires it so you can remove the package.
    $ yum remove mlocate
    

How to get original visitor IP from Cloudflare

by 0

Clouldflare use header params:  HTTP_CF_CONNECTING_IP to provide original IP


Read more »

Build multi-platform IOS, Window mobile, Andorid app with Intel XDK

by in 0

Mobile development with web technologies is nothing new. Thanks to tools like PhoneGap and Appcelerator Titanium, web developers can create hybrid apps that have access to the device's hardware. A new solution for HTML5/CSS/JavaScript development is Intel's XDK. In this article, I'll tell you why it's worth giving it a try.

If you are involved with mobile development, you've probably heard of or used tools such as PhoneGap or Appcelerator Titanium. These tools allow web developers to use their web development skills to create hybrid mobile apps.
Last year, Intel purchased appMobi and packaged their development tools into the Intel XDK. This streamlined, unified product is a complete toolset for mobile development. A developer can go from the first lines of code to a fully compiled application in with just one set of tools. And best of all, the XDK is free to download.

Read more »

What is the difference between Cloud Server (Cloud VPS) with VPS

by in 0

Traditional VPS’s do not have centralized storage which means if your node goes down you could be down for hours. If your data is corrupt in a VPS environment it might be gone forever. Also, if you want to scale on your VPS you are limited based on the amount of resources that is on the node your data is on.


Read more »

adf.ly, lienscash.com, adfoc.us, bc.vc bypasser extension for Chrome

by in 3


No longer worry about adf.ly...

Ketnooi Paid Link Bypasser extension for Chrome

Just install this script and enjoy the auto bypassing on that bad websites (currently adf.ly, lienscash.com, adfoc.us, bc.vc).
This script is compatible with Chrome/Chromium.
Report to me any problem, and.. thanks for using the script!

Version 5.1
- fixed bc.vc again
- fixed AGAIN adf.ly bypasser (HiTommy? Really?)
Version 5
- fixed adf.ly again (nice try I should say)
Old changelogs are available in the script source.

Link download:
Chrome store
or
Download

Install:
- Extract
- Drop n Drag file .crx into Extension manager of chrome

Just comment here to let me know any problem while using this extension

View all animated gifs in a folder at the same time?

by 0

Window don't support this function
So we have to create a html which contain all gifs in the folder

Open notepad, put this text inside:


FOR /F %%G IN ('dir /B *.gif') DO echo ^^ %%G^
 >> gifs.html
Save as "showgifs.bat"

Then run it. The script will generate file gifts.html
Then You can opoen that file with any browser

Replace a color with another with GIMP free photo editor

by 0

In GIMP, to change white to blue:
  • Open the image file
  • menu Colors/Map/Color Exchange
  • Press the colour selection for "From Color". Set R, G and B to all 255. Press OK button.
  • Press the colour selection for "To Color". Set R and G to all 0. Set B to 255. Press OK button.
  • Press OK button.
White and black are special... If you want to translate all other colours then:
  • Open the image file
  • menu Colors/Hue-Saturation
  • Press "Master" button
  • Drag the Hue slider

You can download Gimp portable in :

Replace Colors with the Replace Color Tool in Firework

by 0

Replacing Colors with the Replace Color Tool
It is very easy to change colors in a photo or object with the color swatch tool. Remember that Fireworks looks at color in pixels. No object has the exact color throughout. This is where the tolerance comes in. You want to play with the tolerance until you get the color variation that picks up all the color shades of the color you want to replace. The picture I am using for this tutorial was taken directly from the Fireworks help topics packaged with the program:

Read more »

get head content of page with jquery

by in , 0

You can use this code:
With Jquery


$("head")
//for example:
alert($("head").html());

With JS:

var headContent = document.getElementsByTagName("head")[0].innerHTML;

Convert a utf-8 string to a utf-16 string in PHP

by in 0

- You could also use iconv.
It's native in PHP, but require that all your text is one charset. Else it could discard characters.
iconv("UTF-8""UTF-16"$text)

- In other way, mbstring supports UTF-16, so you can use mb_convert_encoding.

source

Best Lightweight and Responsive Front-End Frameworks

by in , , , 0

With fast processing websites in huge demand, developers have switched their preferences. From adding new functionality, to make their responsive frameworks lightweight while ensuring seamless and fast processing across all devices. Having a lightweight and responsive website is the need of the hour as visitors usually don’t prefer sites that take time to load.
In this era of speed, all you need is a lightweight and solid base to build your responsive website. Here are a few lightweight front-end frameworks that can aid you in your work.

Read more »

Localize Your Android Apps (Default files and folders)

by in 0

Thinking about localizing your android app, well it is without a doubt a great way to popularize your app. Localization is one of the fastest growing trends in the app world today.
Localization is a process to provide resources for your app in accordance with the language setting of the device. The need to provide support of local language on the app is due to the fact that most users prefer reading and communicating in their local language.
Before you jump into this localizing wagon make sure what you want from your app. You want to target only the local audience or global audience as well?
Localizing your app is only beneficial if you’re targeting different regions with variety of languages. In order to appeal to more-and-more users, your app should support texts, currency, audio files, numbers, and graphics according to the locales.
If you want to make your android app global, you need to support local languages. For this you require resource files that are placed in the subdirectories of “res” folder. An additional directory is created inside “res/” which enables you to use a resource in a particular locale. Inside this directory, include a hyphen along with an ‘ISO 639-1 language codes’ at the end of the directory name. After this you can add two optional letters ‘ISO 3166-1-alpha-2 region code’ (preceded by ‘r’).
The inclusion of region qualifier helps in hitting the target resource more effectively. For instance, use ‘-es-rES’ for Espana (Spanish spoken in Spain) and ‘-es-rUS’ for Estados Unidos (Spanish spoken in Latin America), instead of ‘-es’ the language qualifier for Spanish.
Now, when the user runs the app and the device’s language matches the language you have specified, the language resources are loaded.

Read more »

Writer SEO hints

by in 0

Often you would have observed that some sentences in the articles or blogs are not perfect. This leads to the question that is sacrificing perfect sentence structure the way to find your space in the writing field?
In the lure to write more creative article or blog that appeals to the target audience, an audience that might not have good control over the English language, writers sometimes have to write less-than-perfect but easily understandable content.
This makes the work of editors that more difficult. Writers should not misuse this privilege and imagine no one will notice. In this article, we will take a look at a few common mistakes committed by writers, and how they can avoid committing them.

Read more »

How to style the first occurrence of an element inside of another element?

by in , 0

Here's my problem.
HTML
<div id="content">
    <h1>Headline</h1>
    <p>First paragraph that needs to be yellow.</p>
    <p>Second paragraph that need not change. :) </p>
    <p>Third paragraph that need not change. :) </p>
</div>
If I use #content p:first-child {color:yellow; } it doesn't work because p isn't the first-child of content... h1 is the first born.
How can I do this without touching the HTML code?

Read more »

PDO query to fetch all tables

by in , 0

Execute the query with PDO::query():
SHOW TABLES;
If you fetch an associative array, the name of the column will be:
Tables_in_databasename
Note: this will list both tables and views. If you must get only tables, use this instead:
SELECT 
  TABLE_NAME
FROM information_schema.TABLES 
WHERE
  TABLE_TYPE='BASE TABLE'
  AND TABLE_SCHEMA='yourdatabasename';

PHP Fix errors if mbstring is not loaded

by in 0

My script work good on shared hosting until hosting disable mbstring

Now my script can't run.
Many functions MB_  mb_strrpos mb_get_info .... get undefined errors.

Read more »