This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set chosenColor to choose color default color {65535, 65535, 65535} | |
set the formattedColor to my hex(chosenColor) | |
on hex(chosenColor) | |
set the hex_list to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"} | |
set the hex_value to "" | |
repeat with i from 1 to the count of the chosenColor | |
set this_value to (item i of the chosenColor) div 256 | |
set x to item ((this_value div 16) + 1) of the hex_list | |
set y to item (((this_value / 16 mod 1) * 16) + 1) of the hex_list | |
set the hex_value to (the hex_value & x & y) as string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var employee = Object.create(matt, { | |
id: { | |
value: '1234', | |
writable: false | |
}, | |
credentials: { | |
get: function() { | |
return this.introduce() + " and my ID is: " + this.id; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- IE9 Pin elements --> | |
<meta name="application-name" content="EventArgs - A Web Development Blog"> | |
<meta name="msapplication-tooltip" content="EventArgs"> | |
<meta name="msapplication-starturl" content="http://eventargs.com/"> | |
<meta name="msapplication-task" content="name=HTML;action-uri=http://eventargs.com/category/html;icon-uri=http://eventargs.com/cloud.ico"> | |
<meta name="msapplication-task" content="name=.NET;action-uri=http://eventargs.com/category/net;icon-uri=http://eventargs.com/book.ico"> | |
<meta name="msapplication-task" content="name=JavaScript;action-uri=http://eventargs.com/category/javascript;icon-uri=http://eventargs.com/favicon.ico"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-bind="with: people"> | |
Important people: | |
<label>First Name</label> | |
<input type="text" data-bind="value: first" /> | |
<label>Last Name</label></div> | |
<input type="text" data-bind="value: last" /> | |
<button data-bind="click: addPerson">Add Person</button> | |
<button data-bind="click: remove">Remove Person</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Canvas designArea = (Canvas)sender; | |
// Create the rectangle and give it a border and fill. | |
// Note that a rectangle with no fill requires users to drag from the border only. | |
Rectangle rectangle = new Rectangle(); | |
rectangle.Height = 120; | |
rectangle.Width = 90; | |
rectangle.StrokeThickness = 1; | |
rectangle.Stroke = new SolidColorBrush(Colors.Black); | |
rectangle.Fill = new SolidColorBrush(Colors.White); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<i:Interaction.Behaviors> | |
<ei:MouseDragElementBehavior/> | |
<i:Interaction.Behaviors> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Represents a drawable circle for use with a canvas element. | |
*/ | |
class Circle extends Shape { | |
num size; | |
/** | |
* Initializes a new Circle instance. | |
*/ | |
Circle(context, positionX, positionY, size, speedX, speedY, color) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var unwatch = function(obj, prop) { | |
var value = obj[prop]; | |
// Delete the property that has the get/set functions specified | |
// then add the property back using the original value. | |
delete obj[prop]; | |
obj[prop] = value; | |
return this; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myObject = { id: 100, name: 'my object' }; | |
// Subscribe to changes to all properties of the myObject object. | |
// The callback accepts the property name along with the previous and current value | |
// of the property. | |
lookout(myObject, function(prop, oldValue, newValue) { | |
// Log the name of the property that changed and it's previous/current value. | |
console.log(prop + ' just changed from [' + oldValue + '] to [' + newValue + ']'); | |
}); |
OlderNewer