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 protected]' | |
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
// 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
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
$(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
<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
// 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
/** | |
* Ticks the block if it's been scheduled | |
*/ | |
public void updateTick(World world, int leafX, int leafY, int leafZ, Random random) | |
{ | |
if (!world.isRemote) | |
{ | |
int meta = world.getBlockMetadata(leafX, leafY, leafZ); | |
//If bit 0x8 is set, the leaves will be checked for decay. |
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
#!/home/andreas/custom-script | |
This will not be treated as code, but if executed in shell, | |
the script located in `/home/andreas/custom-script` | |
will run and be executed, passing the path to this | |
file as the first parameter. |
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
#!/bin/javash | |
# Both Bash and Java comments supported (not a feature, I was just too lazy to force one or the other) | |
// Some basic commands are included | |
echo("Hello world!"); | |
// Others, you have to manually run | |
String currentDir = run("pwd"); | |
echo(currentDir); |
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
# prompt examples: | |
# [3 jobs master] ~/code/myproject/foo | |
# [1 job my-branch] ~/code/bar/ | |
# ~ | |
# Very, very fast, only requiring a couple of fork()s (and no forking at all to determine the current git branch) | |
if [[ "$USER" == "root" ]] | |
then | |
export PS1="\e[1;31m\]\u \[\e[1;33m\]\w\[\e[0m\] "; | |
else |