This file contains hidden or 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
| // This code sets up the input box to auto-complete | |
| $("#step1-search-address-input").autocomplete({ | |
| source: map.getAutocompleteData, | |
| select: map.onAutocompleteSelect | |
| }); | |
| // This code is contained in the Map class | |
| Map.prototype.initialize = function() | |
| { |
This file contains hidden or 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
| <script type="text/javascript"> | |
| function optional(required, optional = 5) | |
| { | |
| console.log(required, optional); | |
| } | |
| optional("a", "b"); | |
| optional("c"); | |
| optional(); | |
| </script> |
This file contains hidden or 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
| $(document).ready(function(){ | |
| var mapOptions = { | |
| zoom: 10, | |
| mapTypeId: google.maps.MapTypeId.ROADMAP, | |
| center: new google.maps.LatLng(41.06000,28.98700) | |
| }; | |
| var map = new google.maps.Map(document.getElementById("map"),mapOptions); |
This file contains hidden or 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
| package | |
| { | |
| import flash.external.ExternalInterface; | |
| /** Will send the text to trace and JavaScript console (if available) | |
| * Only to be used for debugging. Not to be used for final release! */ | |
| public function log(...args:*) : void | |
| { | |
| //Nothing to log | |
| if (args.length <= 0) { return; } |
This file contains hidden or 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
| // AS3 | |
| switch (country) | |
| { | |
| case ITALY: | |
| case LUXEMBOURG: | |
| age = 16; | |
| break; | |
| case UK: | |
| case SWEDEN: | |
| case FRANCE: |
This file contains hidden or 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
| post_id: /actionscript/why-my-one-line-if-statements-are-unusual | |
| date: 2013-04-14 14:36 | |
| name: 'Andreas Renberg' | |
| email: 'email@site.com' | |
| link: 'http://iqandreas.github.com' | |
| comment: 'Hello world! | |
| This is a multi-line comment. | |
| If an apostrophe is found, it''s doubled.' |
This file contains hidden or 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
| post_id: /actionscript/why-my-one-line-if-statements-are-unusual | |
| date: 2013-04-14 14:36 | |
| post_title: 'Why my one line if statements are unusual' | |
| return_url: 'http://IQAndreas.github.com/actionscript/why-my-one-line-if-statements-are-unusual/' | |
| name: 'Andreas Renberg' | |
| email: 'email@site.com' | |
| link: 'http://iqandreas.github.com' | |
| comment: 'Hello world! | |
| This is a multi-line comment. |
This file contains hidden or 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
| coffee.fill(); | |
| while (coding) | |
| { | |
| coffee.temperature--; | |
| if (coffee.temperature <= 0) | |
| rememberAboutCoffee(); | |
| } | |
| function rememberAboutCoffee() | |
| { |
This file contains hidden or 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
| // Taken (with some modifications) from http://actionsnippet.com/?p=1451 | |
| private function difference(angle1:Number, angle2:Number, max:Number = 360):Number | |
| { | |
| const m:Number = max / 2; | |
| var v:Number = ((angle1 - angle2 + m) % max); | |
| return (v > 0) ? (v - m) : (v + m); | |
| } | |
| private function getClosestTime(hoursProgress:Number, index:int):int | |
| { |
This file contains hidden or 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
| package | |
| { | |
| public const TAU:Number = Math.PI * 2; | |
| } |