Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
##jQuery
Task | Code |
---|---|
Change the background color of '#target' by script. | $('#target').css('background', 'blue'); |
Change the text in the span, a child of '#target' | $('#target span').text('foo:bar'); |
Create a clone of the span in '#target' and position it under the orgin. | $('#target span').clone().insertAfter('#target span'); |
Change background color of the second of three '.target'. | $('.target').eq(1).css('background', 'blue'); |
Disable the button | $('.target button').attr('disabled', 'disabled'); |
Uncheck the boxes | $('.target input').removeAttr('checked'); |
Move '#child' from '#parent1' to '#parent2' | $('#child').appendTo('#parent2'); |
Make the textbox in '#target' read-only | $('#target input').attr('readonly', 'readonly') |
General
The first thing that really surprised me today was the flexibility of Ruby's shovel operator, <<
. A student in the class had tried the following:
a = [0]
a << a
What do you think a
is now? I was sure it would be [0, [0]]
. But lo and behold, Ruby sparkles;
a = [0]
a << a
#Homework for June 18, 2013
##Calculator 1 Create a command line calculator. It should have a basic and advanced mode.
basic calculator (+, -, *, /) advanced calculator (exponents, square root)
For a basic calculator, press 1.
#Homework for June 18, 2013
##Calculator 1 Create a command line calculator. It should have a basic and advanced mode.
basic calculator (+, -, *, /) advanced calculator (exponents, square root)
For a basic calculator, press 1.