Showing posts with label internet. Show all posts
Showing posts with label internet. Show all posts

Tuesday, July 17, 2012

htaccess file invisible on ftp

Once again i faced with this problem...

I have connected to ftp to edit htaccess file but it is invisible. I use PSPad Editor with ftp client support.

Here is how to fix


Invisible files on ftp in PSPad:
1. Edit your ftp connection
2. Check checkbox with text - "Show hidden files (must be supported by FTP server)"
3. Reconnect
4. Done.

Cureftp fixing hidden files:

1. Open CuteFTP and Enter Hostname , Username and Password.
2. Click Action tab in Settings
3. Click on Filter button
4. tick on Enable server side filtering
5. Enter -a in Remote filter
6. Click on apply & connect.

FileZilla fix to see invisible files:

For FileZilla 2,
1. Click on Settings.
2. Select Edit -> Settings -> Interface settings -> Remote file list
3. Tick check box syas Always show hidden files & press ok.

For FileZilla 3,
1. Click on Server from top navigation.
2. Click on Force showing hidden files at last option
3. Press ok when it shows warning.

Tuesday, February 28, 2012

Facebook Identity Card


The FB Bureau is handing-out personal identification cards for a limited number of Facebook citizens, interested in alpha testing.
Next time someone needs to “see your ID” – How about showing a Facebook ID card instead of the documents your government gave you? On the web this is common practice for millions of people already. Therefore – Forget privacy.
Can I See your Facebook ID?
With more than 800 million users Facebook is the dominant identity system on the web. When signing-up for new services around the open web it's quite common to use Facebook Connect instead of creating a new user account. People stop ranting on blog comments because they only allow comments connected to your "real name" aka "Facebook Identity" (till the end of time). For the good or bad we are losing anonymity and Facebook Inc. is establishing order in this "world wild web" (for profit, not necessarily for the good of society).
Governments like Germany have released new passports that offer online identity checks as well, but they will likely never succeed with their technologies given the already existing structure of Facebook, powered by lazieness (or convience). The other way around though - A future where a Facebook Identity becomes more important than any governments' doesn't seem unrealistic. This possible future is already half-way there. What is exciting about this, what can be our role as artists and why should one even bother? Let's find out!
Next time someone needs to "see your ID" - How about showing a Facebook ID card instead of the documents your government gave you? On the web this is common practice for millions of people already. Therefore - Forget privacy. The user's next battle is about nothing less but who controls your identity, and we still might have something to say about it.
Source: http://fbbureau.com/

Thursday, January 26, 2012

Change prestashop stores google maps zoom


Good day visitor.

In prestashop there is "Stores" section.

To change zoom of the default map which loads up after navigating there, go to:


  • /js/ folder
  • open stores.js
Go to line 196.

You will see code like this:

map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(defaultLat, defaultLong),
zoom: 15,
mapTypeId: 'roadmap',
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}
});

Change Zoom to whatever you like.

Good luck!

Wednesday, January 18, 2012

Days in months of year


Are you lazy to count how many there are days in months of certain year?

I have created small php counter for my self.

Its pretty useful so i want to share it.

http://www.drunksick.com/index.php?p=daysinmonth

Main part of code:

for($year_s;$year_s<$year_f;$year_s++)
{
  for($month=1;$month<=12;$month++)
  {
    echo $month."'th month of ".$year_s." has: ".cal_days_in_month(CAL_GREGORIAN, $month, $year_s)." days
";
  }
}

Friday, December 30, 2011

Count emails on gmail.com

As the app says they will generate report in which you will see various information about your year using of gmail.com.

I disappointed a bit after i couldn't login into the site on chrome.
And finally it will take up to 72 hours to generate report. So i still didn't got mine yet :)

We’ll scan your emails, and email you a private link when it is ready. Due to the overwhelming demand for these reports, we're advising everyone that it may take up to 72 hours as we get through everyones Emails.

Anyway i think that its cool tool too found out how effective was your gmail account.

Source: https://yearinreview.toutapp.com

Friday, November 18, 2011

Explode mysql select value



Today i have faced again with same problem - I was forced to explode value while selecting in MySQL.

Value of the field looks like - Kaina: 60000 LT (17376 EUR)
And i need this - 60000

So i made the select query:


SELECT
SUBSTRING( SUBSTRING_INDEX(`field`,' LT',1), -7) as `field_sub`
FROM `table`


As you can notice, first i have exploded the field value so it be like - Kaina: 60000
After i removed first 7 symbols.

Done... i got 60000

GL

Thursday, September 8, 2011

Prestashop CMS block location header



Several days ago i faced with prestashop problem. I tried to hook right column cms block to header. But as prestashop developers says, that it was developed to hook only left or right side.

So here is my solution for this:

in global.css i changed right_column class position to relative and moved it up.

CSS looks like this after my changes:

position: relative;
left: 0px;
top: -200px;
width: 191px;
margin-left: 21px;
overflow: hidden

After this my center_column looked weird ( not full width ) and chaing it's width changes everything ( right_column drops down and starts to move... ). So i figured out this solution for the place: I changed center_column position to absolute, added padding-left so it dont overlay on left_column and added width which i was required from the beggining.

CSS looks like this after my changes:

position: absolute;
padding-left: 290px;
width: 810px;
margin: 0 0 30px 0;
overflow: hidden


Good luck with you prestashop hacking!

Saturday, July 2, 2011

Seo keywords optimization tools.


Currently working on my own new project. In the project im trying to create tool for monitoring seo keywords of other projects.

I have a lot fun and im trying to use most newest tools to create it. There already is some good tools, like keywords searching, google pagerank counter, urls counter, google analytics monitoring and much much more coming!

Hope to see some testers there and ill would like to hear some suggestions from your side if you are very interested in it.

It is a bit bugged for now but ill fix everything very soon.

Also it will be multi language project. But for beggining there will be only 2 languages - Lithuanian and English.

Source: http://www.igloro.info

Thursday, June 16, 2011

Optimize your website

At work as programmer i need to optimize page load time.

So here is some tweaks which you can use for your own web sites.

1. Optimizing your CSS and JS ( Javascript, Jquery and so on... ).
All pages uses css and js. Most of time they are huge. like 50-500 kb for css and same for JS.

Most of time i use the tool to see how fast my page is loading:

http://tools.pingdom.com

Best way to optimize CSS is:
Explode CSS files by parts and use only required ones for pages you are using. After compress it with such tools as http://www.cssdrive.com/index.php/main/csscompressor. And in same time combine these ones together into one single load ( search google for CSS.php combiner ).


Best way to optimize JS is:
Explode by files and use only required code you are using. Compress these files with tools like this: http://www.compress-javascript.com/ ( Some codes don't work after compress, you can try to find another good compressor which will compress better than this one. Let me know if you find anything.. )
In same time combine them with combiners into one file. ( search google for JS.php combiner ).

2. Cache! Best way to optimize website is to use cache.
There also some good tweaks about cache. For example using GZIP cache.
Most of time gzip compressed code with 80% success. For example if you code is 100kb, gzip will compress into 20kb and load it into user browser.
To check gzip compression im using such tools as this one: http://www.whatsmyip.org/http_compression/

3. Images! Less images - better. But as you know, logos and so on.. are important for web sites.
Big web sites as facebook using very nice technique - one big image with all images: http://static.ak.fbcdn.net/rsrc.php/v1/zi/r/uVYVvAILt0K.png

4. HTML, PHP code optimization gives some results too. Spaces, tabs, else { } and so on are pretty good on lowering some kbs...
but each kb less will be some gigabytes less for server load per day-week-month if your web site is big!.

5. Javascript lazyloading - it is very nice tool for loading images. It will load image only if user sees the image. If the image is not in visible spot, it will not be loaded.
Source: http://www.appelsiini.net/projects/lazyload

And remember, that visitor is important of all web sites!

Monday, May 16, 2011

Google chrome Program too big to fit in memory [ Solution ]


Today for first time i meet the problem.

I was browsing as always... many tabs - like 10. Most of them are text. Suddenly my pc showed BSOD. After restart google chrome want start. And shows cmd windows for a second.

With cmd.exe ( start > cmd.exe ) , you can run same google chrome to see error message. It was - "Program too big to fit in memory".

After some google searches i read nothing interesting but only complains and questions about the problem.

I was not worried about my bookmarks because im using google sync.

1. So i just opened firefox.
2. Went to Google Chrome download page.
3. Downloaded / Ran setup
4. After installation all came back to normal.

Also last session was saved... and i could see pages which was opened before BSOD.

In worst situation you can lose your bookmarks. So its up to you...

Leave a comment if your bookmarks haven't erased after install. If you didn't used google sync. Cheers.

Hope it will help you guys. 

Sunday, April 10, 2011

CSS trick to cover with perfect background width and height


There is one cool trick to fill place with background, even if their sizes different. Just use the code for css:
body {
background-image: url(bg.jpg);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

The goal here is a background image on a website that covers the entire browser window at all times. Let's put some specifics on it:

  • Fills entire page with image, no white space
  • Scales image as needed
  • Retains image proportions (aspect ratio)
  • Image is centered on page
  • Does not cause scrollbars
  • As cross-browser compatible as possible
  • Isn't some fancy shenanigans like Flash

We can do this purely through CSS thanks to the background-size property now in CSS3. We'll use the html element (better than body as it's always at least the height of the browser window). We set a fixed and centered background on it, then adjust it's size using background-size set to the cover keyword.

Works in

  • Safari 3+
  • Chrome Whatever+
  • IE 9+
  • Opera 10+ (Opera 9.5 supported background-size but not the keywords)
  • Firefox 3.6+ (Firefox 4 supports non-vendor prefixed version)

Source: http://css-tricks.com/perfect-full-page-background-image/

The article can also mean: css tricks

Saturday, April 2, 2011

htaccess doesnt work on windows of xampp [Solved]


My situation: I have xampp and perfectly working website. And problem is that site does nothing, while changing htaccess.

Here is solutions for this:

  • go to xampp folder and search for httpd.conf in apache/conf folders.
  • open it
  • make sure that LoadModule rewrite_module modules/mod_rewrite.so is uncommented
  • find all AllowOverride and changed None to All. All AllowOverride!!! There should be 3 of them..
It worked for me.. and might help you.

Happy htaccess editing!

Thursday, March 31, 2011

Page speed checker by Google



Here you go... google launched Page speed online analyzer. While it analyzes, it gives you lots of suggestions after completeing them, you website speed will improve!
There is 2 methods of analyzing - Desktop and Mobile. After analyze you will get number from 0 till 100 which describes your result of website speed.

URL: http://pagespeed.googlelabs.com/

Tuesday, March 22, 2011

Rounded corners border CSS Problem in IE [ Internet Explorer ] [ Joomla ] [ Solved ]


Here you go.. There is an css code for "good" browsers to change your div's corners to rounded ones. But "bad" browsers such as Internet Explorer ( IE - IE6, IE7 and so on... doesnt works pretty good under this conditions.. ), so here is solution for this problem.


CSS CODE EXAMPLE OF DIV WITH CLASS = "box"
.box {
-moz-border-radius: 15px; /* Firefox */
-webkit-border-radius: 15px; /* Safari and Chrome */
border-radius: 15px; /* Opera 10.5+, future browsers, and now also Internet Explorer 6+ using IE-CSS3 */
-moz-box-shadow: 10px 10px 20px #000; /* Firefox */
-webkit-box-shadow: 10px 10px 20px #000; /* Safari and Chrome */
box-shadow: 10px 10px 20px #000; /* Opera 10.5+, future browsers and IE6+ using IE-CSS3 */
behavior: url(ie-css3.htc); /* This lets IE know to call the script on all elements which get the 'box' class */

}

There should be like this: "behavior: url(path/to/ie-css3.htc);"

Download url of the ie-css3.htc file. Put the file into root and css folder. ( and into other folders in other cases.. ^^ ):
http://uploading.com/files/dm247e4c/pie.zip/

I faced with this problem while doing rounded corners in Joomla template. Also this resources might be helpful

Friday, February 25, 2011

Hidden new line in string PHP


I guess you seen the problem, or maybe facing with it at the moment. So if you echo the string with pre tags, it will show normally. But without pre tags, it shows ugly... just like a plain text.

The problem is that there is hidden new lines symbols like /r or /n and so on...

Just by replacing the with str_replace is not enough. So here solution for it:

$value = preg_replace('/[\r\n]+/', '\n', $value);
echo htmlentities($value);

Thursday, February 17, 2011

How to test your hardware for problems

To find problem in your hardware you need to test everything... But you need to think... I mean, if windows loads up it means that video card, hard disk, rams, and so on works... Possible case - they works not good as "good", but they still works.

Anyways..

Here is some list of programs and other tricks i found while searching internet how to test your hardware parts.

Ram ( Random Access Memory ):
To test your RAM, you can do just by checking your Task Manager ( Performance tab ). Also you can see how many rums installed by going to "my computer"'s properties.
In harder cases people recommend to download these programs:
Most of the information was fount on ehow.com

Hard Disk ( Hard Drive ):
Most of test which you can do for your hard drive is installed in windows. It called "checkdisk" or chkdsk.exe, you can run it from command line. In other case you can do that from your file explorer:
  1. Go to computer, 
  2. Select hard drive
  3. Open properties
  4. Choose tools tab
  5. Press "Check Now" button, in "Error-checking" section
  6. In showed up windows check all possible check boxes and press Start.
  7. Wait until finishes and press Done. 
Also you can test your hard drive with SeaGate tool ( http://www.seagate.com/www/en-us/support/downloads/seatools ). 16,7 MB

Funny part of this, is that you can listen for sounds which hard drives are making ( in case if it is still working ), and check if it matches one of these ones: http://datacent.com/ . If it does,... i guess you need to change it.

More useful freewares such as "Hitachi Drive Fitness Test" or "Samsung HUTIL" and so on... can be fount here: http://pcsupport.about.com/

GPU ( Graphic Process Unit ):
First of all windows has included tool for this - dxdiag . You can run it from Command line.
  1. Press Start 
  2. Run 
  3. Cmd.exe 
  4. dxdiag 
  5. hit Enter
  6. check Dispay tab, for video card information.
Most popular method to test your video card is to install and run one of Benchmarks product 3DMark. http://www.futuremark.com/

Motherboard:
If motherboard is not working properly you will notice it. Some of these facts says about it:
  • Computer does not boot, and instead gives beep sounds.
  • Computer random crashes.
  • Computer randomly reboots.
and so on..


One of great software to test motherboard is Hot CPU Tester.

Sunday, January 9, 2011

Joomla Error loading feed data



The error occurs after installing joomla.

So fix the thing all you need to do is:
1. go to administrator panels
2. Extensions -> Module Manager -> Administrator tab
3. Find "Joomla! Security Newsfeed"
4. Disable it
5. Done
If you have the “yoo_tweet module” installed, disable this module as well.  This module is known to display this error message.

Why:
Because this module load feed data with link http://feeds.joomla.org/JoomlaSecurityNewsthis link is broken, so it pop up a error loading feed data error.

Have fun!

Thursday, January 6, 2011

Finding time difference in seconds between 2 dates ( timestamps )


In my situation i needed query to find time difference in seconds between current time and field's value.
SELECT TIME_TO_SEC(TIMEDIFF(NOW(),`field_name`));
between 2 mysql fields can look like this:
 SELECT TIME_TO_SEC(TIMEDIFF(`field_name1`,`field_name2`));

Tuesday, December 14, 2010

Clickable TD


So, if you wonder how to do whole into clickable area, here is solution:

Add this into td tag:
onClick="window.location='http://www.yahoo.com'"

Done.

Wednesday, November 17, 2010

Joomla template installation problems


Today for first time i tried to install new Joomla! template.

The problem is that i'm total noob at Joomla! And errors which i had was:

1. JFolder::create: Could not create directory
2. Error! Could not find an XML setup file in the package.
3. Your Extension appears to be written for an older version of Joomla!. You must enable the System - Legacy Plugin in the Plugin Manager if you wish to complete this task.
4. Template Install: Failed to create directory.
And so on..

So after 1 hour of power-googling for solutions i finally figured out how to solve them one by one:

First of all, some templates are bugged. You can check it by opening templateDesigh.xml file ( inside of templates zip file ). If it starts with install tag, that means it's bugged. All you need to do is to change install tag to mosintall tag ( don't forget about closing tag at end of the file ).

Secondly, when my first Joomla! was install, some how "tmp" directory wasn't created. So go and create tmp directory if you missing it too.

And finally last and most important solution which helped me is changing all directories of Help -> System info -> Directory Permissions, CHMOD from 755 to 777 .

Also you might have problems with Safe mode in Help -> System info -> PHP Settings, because it should be Off, and some guys has it On.

Good luck.