Ikram Hawramani's Blog
Thursday, September 13, 2012
Wednesday, March 21, 2012
CSS: Select ID or class with a slash or quote in it
I recently faced the interesting task of CSS-selecting an ID that looked like this:
\"ws_widget\"
What is that monster? It is an ID with a slash AND a quote in it.
Here is what the CSS rule looks like:
#\\\"ws_widget\\\"{
position:relative;
}
There is a slash to escape the first slash, and another slash to escape the quote.
If you only had slashes in your ID, like the following:
\my_id\
the proper CSS selection would look like this:
#\\my_id\\ {}
Sunday, December 18, 2011
How to add new subscriptions in Google Reader
After the recent changes to Google Reader I wanted to subscribe to a new blog and spent about 10 frustrating minutes looking around the interface to find a subscribe button. I eventually ended up pressing random letters on my keyboard, knowing that one of them would open the subscription dialogue box. It happened to be the letter 'A'.
Today I found out that the subscription link can be found by hovering your mouse over 'Subscriptions', which reveals a downward arrow on the far right, pressing this arrow opens a menu, and at the bottom of this menu there is an 'Add new subscription' link.
Quick instructions: Press 'A' on your keyboard, or hover your mouse over Subscriptions->Press the downward arrow on the far right->Click on the 'Add new subscription' link.
Sunday, October 9, 2011
A Photoshop-like guide (or ruler) for Windows
If you open a window (such as the calculator, Notepad, or Explorer), you can use the window's edge as a guide to align elements (pretty useful in web design if you don't want to use anything fancy).
What makes this technique especially helpful is that while dragging the window, you can press the Ctrl key, then use the arrow keys to shift the guide pixel by pixel.
Friday, July 29, 2011
Solution: Asus Eee PC 1015XP stuck on update
Sunday, June 5, 2011
Solution for Perl: JSON AJAX string is broken (corrupted) on space
The solution is that in JavaScript change your JSON like this:
var json = JSON.stringify(stuff); //like normal var key = 'sham='; //this can be any string--followed by the equal sign var finaloutput = key+json;
On the server side, do this:
if(param()) {
my $json = param('sham'); #sham is the string you chose as the key
}Things should work correctly from there.
Saturday, March 19, 2011
Perl boolean XOR
xor:say (1 xor 0)The above code returns 1 signifying a true return value.
It is at the bottom of the precedence chart, you'll often have to use parenthesis to make it work correctly.
Friday, February 18, 2011
Can 32-bit programs make use of more than 4 Gigabytes of RAM?
I run Windows 7 64-bit. I had 4 Gigabytes of RAM, and since I always have Linux running inside Windows, and since I have disabled the Windows pagefile (performance is much, much better with this disabled. Minimized programs open up in an instant now, even with 20 programs open at the same time), I kept getting the low RAM message. This usually happened when browsing the web and opening many tabs.
I bought a good 1GB RAM stick for $20 on Newegg.com and installed it today. To test whether my 32-bit programs can benefit from the extra RAM, I opened up Google Chrome (a 32-bit program) and started opening a high quality picture in many tabs. After opening it in 20-30 tabs, my RAM usage approached the 5 gigabyte limit and I received the low memory warning.
This proves that somehow Windows 7 can allow 32-bit programs to utilize areas of RAM that theoretically can't be addressed using the 32-bit system.
Therefore regardless of whether the programs you use are 32-bit or 64-bit, as long as you use Windows 7 64-bit, you can make good use of 4GB+ RAM.
Tuesday, February 15, 2011
Notepad++: Change Vertical/Horizontal Split Orientation
- Right-click on the dotted border between the two views.
- Click on the rotation you want.
Saturday, February 12, 2011
How to attach and send executable files in Gmail
Then attach and send.
Friday, February 4, 2011
How to type a semicolon in Arabic
Shift + P. (i.e. press the P key while holding down the shift key)My settings for typing Arabic are Saudi Arabia - Arabic 101 Keyboard Layout.
As a side note, to type a comma use
Shift + K, rather than Shift + <, since the latter types something that doesn't look like a proper Arabic comma.
Friday, January 7, 2011
How to change Ubuntu keyboard cursor shape
In the Edit menu click 'Profile Preferences', then on the 'General' tab choose the cursor shape you want where it says 'Cursor shape:'.
Monday, January 3, 2011
How to extract (decompile) CHM files into HTML
The great thing about decompiling CHM files is that I can now read CHM books inside Google Chrome, rather than inside Microsoft's horrible browser.
A great free desktop search engine
This is highly superior to Google Desktop with its various limitations on what you can do. For example, Locate32 lets you specify a single folder to search for the word you want, using the "Look in: " box in the "Name & Location" tab.
Tuesday, December 28, 2010
Solution for Error: Cannot retrieve repository metadata (repomd.xml) in Fedora 14
Monday, October 19, 2009
How to sum up the contents of a column in Excel or Google Docs
Monday, May 18, 2009
Difference between str and repr in Python
Thursday, April 9, 2009
Solution for Active Desktop Recovery popping up after every restart [Windows XP]
Tuesday, March 31, 2009
Solution for blogger template's "undefined" date
To solve this, change the Timestamp format in the Settings-->Formatting tab. Changing it to the 4th one solved my problem.