Showing posts with label reference. Show all posts
Showing posts with label reference. Show all posts

Wednesday, July 13, 2011

Cool I want to remember link

Uhh... need to bookmark this (but sharing in post is a good method too)

Convert your code into HTML format
http://puzzleware.net/CodeHTMLer/default.aspx

Monday, July 11, 2011

CSS I need to remember link

CSS I need to remember link, but I always forget

http://www.w3schools.com/css/css_howto.asp

<style type="text/css">
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
</style>

Thursday, April 7, 2011

Smashing magazine I want to remember link

Here is the link from smashing magazine that is useful to me

Useful JavaScript and jQuery Tools, Libraries, Plugins
http://www.smashingmagazine.com/2011/04/07/useful-javascript-and-jquery-tools-libraries-plugins/

Speeding Up Your Website’s Database
http://www.smashingmagazine.com/2011/03/23/speeding-up-your-websites-database/

Tuesday, February 8, 2011

Javascript numeric input

This is my cheatsheet while playing with the javascript, always forgot about them so I job it down here

Easy to find, one of them is in here
http://javascript.internet.com/forms/validate-numeric-only.html

Round a number into 2 decimal place
var result = Math.round(annualPremium*100)/100



Convert string to Integer
http://www.keyboardface.com/archives/2006/04/04/javascript-string-to-int/
parseInt(10.10) //Return 10



Another alternative for number format
http://www.pageresource.com/jscript/j_a_03.htm
profits.toFixed(2) //returns 2489.82
profits.toPrecision(4) //returns 123.5 (round up)



Check is numeric
http://andrewpeace.com/javascript-is-numeric.html AND http://bytes.com/topic/javascript/answers/526119-convert-double-cdbl-javascript
valueCredit = document.getElementById('thisIsSparrta').value;
if( valueCredit != '' && !isNaN(valueCredit)){
    totalCredit += parseFloat(valueCredit);
}



Adding and removing 'readonly' attribute to element
http://bytes.com/topic/javascript/answers/655784-change-textbox-readonly
document.getElementById('helloworld').setAttribute('readonly', true);
document.getElementById('helloworld').removeAttribute('readonly');


Change the element background
http://www.codeproject.com/KB/scripting/focusBGColor.aspx
document.getElementById('helloworld').style.backgroundColor = '#EBEBE4';


Select all the text in textbox
http://javascript-array.com/scripts/onclick_select_all_text_in_field/
document.getElementById(id).focus();
document.getElementById(id).select();

p/s: Remember not to use 'onclick' function because just in case the user dont want to select all (they made typo mistake and want to remove only 1 character)


Check the element has what attribute
There is a source, but I forget whare I take it from
document.getElementById.hasAttribute('acinput')

p/s: The attribute can be anything actually, typically is 'readonly' for textbox

Thursday, November 4, 2010

Redhat I always use command

Last update, 25 April 2011
This is not only for Redhat, but for most of Linux machine (I think)

Source of this command is from here. I keep using them
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4/html/Step_by_Step_Guide/s1-manipulate-current.html
http://redhat.activeventure.com/71/gettingstartedguide/s1-managing-working-with-files.html

This is a good reference for VI - Visual Editor (Command line interface for text editor)
http://www.cs.colostate.edu/helpdocs/vi.html

Check folder size
du -hs /path/to/directory


Check harddisk space
df


List all the content within the current folder (or path)
ls OR ls -all


Remove file
rm thefilename.txt


Move file
mv thefilename.txt /home/asipo/


Delete directory and all its content
rm -rf /home/asipo/backupdocuments


Zip a file or folder
zip -r iWantTheZipFileNameToBeLikeThisOkay.zip theActualFileName.txt


Unzip a file (not sure for folder)
unzip thefilename.zip


Change folder owner
chown -R asipo.asigroup '/var/www/smellynomore/app/tmp'


Change folder permission
chmod -R 777 '/var/www/smellynomore/app/tmp'


Copy all except one folder

shopt -s extglob
cp -r A/!(B) dest_dir


Execute bin file
chmod u+x qt-sdk-linux-x86-opensource-2010.05.1.bin
./qt-sdk-linux-x86-opensource-2010.05.1.bin

Connect to server and control it (Telnet / SHH I think)
ssh -p 22 asipi@langit.com.my