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
<?xml version="1.0"?> | |
<level name="Basic Level" size="480,1000"> | |
<!-- corners --> | |
<wallArc at="100,100" relativeTo="topleft" | |
size="100,100" angles="180,270" /> | |
<wallArc at="-100,100" relativeTo="topright" | |
size="100,100" angles="270,360" /> | |
<!-- from top left to top right --> |
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 linkify = (function() { | |
var replaceSubstr = function(text, i, j, substr) { | |
return text.substr(0, i) + substr + text.substr(j); | |
} | |
var mergeByIndices = function(a, b) { | |
var i = 0, j = 0, result = []; | |
while (i < a.length || j < b.length) { | |
if (i < a.length && (j >= b.length || a[i].indices[0] < b[j].indices[0])) | |
result.push(a[i++]); |
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
// This can be used for a basic line instead of making a texture yourself | |
Pixmap pixmap = new Pixmap(1, 1, Format.RGB565); | |
pixmap.setColor(1f, 1f, 1f, 1f); | |
pixmap.drawPixel(0, 0); | |
pixelTexture = new Texture(pixmap); | |
pixelTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear); | |
public void drawLine(SpriteBatch batch, float x1, float y1, float x2, float y2, float width) { | |
drawLine(batch, pixelTexture, x1, y1, x2, y2, width); | |
} |
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
### | |
module Enumerable | |
# maps an array into a hash | |
def to_h(&block) | |
inject({}) {|hash, *v| block.call(hash, *v); hash} | |
end | |
end | |
class NilClass |
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
//;" | |
/*" | |
code = <<-CODE.chop | |
class AJavaClass { | |
public static void main(String[] args) { | |
System.out.println("#{Random.rand(100)}"); | |
} | |
} | |
CODE |
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
#!/usr/bin/ruby | |
file = IO.read("src/embs/Sink.java") | |
sinks_choice = [] | |
sinks_choice << [ | |
{:id=>1, :channel=>0, :panid=>11, :n=>10, :t=>500, :start=>300}, | |
{:id=>2, :channel=>1, :panid=>12, :n=>4, :t=>700, :start=>300}, | |
{:id=>3, :channel=>2, :panid=>13, :n=>5, :t=>1500, :start=>300}] |
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
// Sort an array | |
array.sort(function(A, B) { | |
var a, b; | |
return (((a = A.field1) > (b = B.field1)) - (b > a)) || // Sort by field1 | |
(((a = A.field2) > (b = B.field2)) - (b > a)) // Sort by field2 | |
}); |
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
for(i=0;++i<101;console.log([i,a='Fizz',b='Buzz',a+b][!(i%3)+2*!(i%5)])); |
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
Show hidden characters
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"dictionary": "Packages/Language - English/en_GB.dic", | |
"font_size": 11.0, | |
"highlight_line": true, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], |
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
object EntityFields { | |
import collection.immutable.Map | |
class FieldPair[T](field : Field[T], value : T) extends (Field[T], T)(field, value) | |
class Field[T](val default : Option[T]) { | |
def this() = this(None) | |
def this(default : T) = this(Some(default)) | |
def ~>(value : T) = new FieldPair[T](this, value) | |
} |
OlderNewer