Text

Javascript : check all the checkboxes in the page

Hello there,

Its been a While since my last Post, and am not gonna be sorry about that, Because I was busy being in and preparing for Hong Kong baby ! wooohoooo

So, you are someone who wants to spam his friends via mail so the sign up to dropbox ? or want to wipe out all your tweets ??

Here is a bit of my touch !

var cbs = document.getElementsByTagName('input'); for(var i=0; i < cbs.length; i++) { if(cbs[i].type == 'checkbox') { cbs[i].checked = true; } }

and that’s all ! use firebug/chrome’s console to run this command and all the checkboxes will be checked !

You’ll be reading more soon ;)

Tags: Javascript
Text

PDO is just a fail

Hi,

I’ve always wanted to try this “awesome” PDO thing, everyone is talking about it, it was like a miracle came from nothing, They are saying that mysql extension is getting deprecated, Bullshit !

Yes, the Old fashioned MySQL extension is planned to be deprecated but in a long term, so why bother with this new PDO thing ? you should, because it is cross-database, which means the same code works perfectly with all supported databases (well maybe few changes but it is ofcourse way better than rewriting every code in the project).

That made me try it, only that, and I got disappointed and I’m feeling bad for the wasted time :(

The main issue I’ve had is that you can do ONE operation on each query, which means if you want to organize an array from your SELECT query after checking if there are rows or not is not possible, you have to re-query again, which is plain bad.

another thing is lack of SQL error reporting, if the query fails, it returns FALSE, and doesn’t return an error or something, which is again Bad, you have to look for the error yourself.

I’ve had other problems like server crashing twice, “too many connections to the server” “MySQL gone away” and that is enough !

I’ll not go back to PDO again, NEVER, Until they deprecate the OLD fashioned MySQL extension, I’ll move to MySQLi or just use another database without bothering with too many retarded details

Best Regards

Text

Starting out with Appcelerator’s Titanium

Oya folks,

You might have heard about the new framework that compiles phone applications to different phone OSes without a single code modification.

Yea that’s right its Appcelerator’s Titanium :

One of the most important features of Titanium is HTML5 support, it supports it nativly, Even after you package it and run it on the mobile, the application will NOT work under a browser object, it will work under its own interpreter.

Using Titanium is fairely simple, Sign Up, download Titanium Studio, and install the Phone SDKs (Blackberry, Android and iOS if you are on Mac)

Working with it however is even easier, if you have some knowledge with Javascript you’ll be able to catch up with its codes very quickly, otherwise there is an awesome Documentation for everything you need, tutorials in the internet are countless too !

One thing is that many Windows 7 users (especially 64bit) have problems with the software detecting JDK paths, Android Paths, and anything Paths, You’ll need to modify environment variable in order to work with the Studio.

I have managed to fix everything, BUT the android issue, the studio is not yet able to detect that I have android-8 Platform API installed :(

how sad I can’t work much more without testing things,however it seems that the linux version is way better detecting everything on its own (isn’t that obvious ? :D ) and I’ll try it as soon as I finish configuring my new HDD.

Best Regards.

Photo
Text

use direct file editing rather than FTP in wordpress

Hi all,

so I’ve merged to Cloud and VPS hosting for a while now, and I’ve been doing a lot of changes in my web life with it, one of the most important things I’ve changed is FTP usage, no more FTP ! but more on that later ;)

so when you try to update a plugin via the dashboard, wordpress will ask for ftp information to connect to the server and update it, well for security measures I don’t have FTP and I won’t.

The alternative for updating plugins without FTP pain is to give Apache user permissions to edit wordpress files,

simply

chmod 777 ./wp-content

your wordpress directory, followed by changing the group of the directory to Apache’s using the following command

chown -R apache:apache

in debian servers you have to use www-data:www-data instead, and in opensuse it is httpd:httpd

if you have another distro running in your server you may want to try looking for the usergroup apache is using before touching anything using 

lsof -l

and looking for apache2 in the first row, the third row should contain the usergroup name, use it !

Warning : Shared hosting people shouldn’t use this method, as it expose them to risks of getting hacked if the server is compromised 

Best Regards !

Photo
Blurrrrrrrrrrrrrrrrrrrrrr

Blurrrrrrrrrrrrrrrrrrrrrr

Text

Move all files and directories from the current folder to the upper folder

Thanks to the Answer found in SuperUser By Stephan202 : 

The command you are looking for is

mv * .* ..

Explanation: the mv command moves files and directories. The last argument to mv is the target (in this case the directory one step “up” in the tree, ..). The arguments before that are the source files and directories. The asterisk (*) is a wildcard which matches all files which do not start with a dot. Files that start with a dot (dotfiles) are “hidden”. They are matched using the pattern .*.

See the manpage which I linked for more information on mv.

Edit: as Chris Johnsen correctly points out: the pattern .* also matches . and ... Since you don’t want to (and cannot) move those, it’s better to use a pattern which matches any filename starting with a dot except those two. The pattern .[^.]* does just that: it matches any filename (1) starting with a dot (2) followed by a character which is not a dot (3) followed by zero or more arbitrary characters.

Edit 2: As Paggas points out, we’d also have to add the pattern .??* in order to match files starting with two dots. See his answer for an alternative solution using find.

Edit 3: Arjan’s answer mentions shopt in order to avoid all those issues with dotfiles. But then there is still the problem with files starting with a dash. And it requires three commands. Still, I like the idea. I propose to use it like this:

(shopt -s dotglob; mv -- * ..)

This executes shopt in a subshell (thus no second call to shopt required) and uses -- so that files starting with a dash will not be interpreted as arguments to mv.

Text

The Stinson Challenge

Challenge Accepted !

Are the words I’ve told to a friend of mine (someone I’ll reveal after he loses the challenge) after he agreed on ‘The Stinson Challenge’

Stinson is Barney Stinson (Neil Patrick Harris) From ‘How I met your mother’ series, He is a pick up artist and he is Awesome !

The Stinson Challenge is to hook up with 50 20 Girl (8 9+/10) Within the next month (duration ends by the scholar year ending) And list each one’s first letter from her name, of course it has some few rules to follow;

1.You can not count old girlfriends

2.You can not hook up with the same girl I hooked up with

3.You can not wear anything but suites during approach

4.You can not ask friends for girls (Must Approach)

5.You must ‘ALWAYS’ look like Barney Stinson, Although must change haircut each week !

6.You must inform your environment that you are doing this

And Obviously I am following the rules; The challenge starts by tomorrow’s morning and ends after a month and a half.

WHEN(/IF) my friend loses the bet, I’ll reveal his identity and He will post some embarrassing pictures of him

IF I lose the bet, I am going to wear a cos-play of Aladdin and go to some major event

Enjoy !

P.S : I am soon going to write some technical stuff again, be ready

Text

note to self

Version control is the most retarded thing I have ever seen

Link

This Article made me re-think about the future of AEF, change plans for its 2.0, and try to remember functions I re-written in 1.1 …..

Though, in Rare cases it is a good idea, I recently re-written my plugin code using OOP, turns to be way better now =)

Anyway, I didn’t finish reading, his point has been made in the first page, maybe the second, Y U WRITE 2 MUCH !