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
.knob { | |
width: 40px; | |
height: 40px; | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
position: relative; | |
background-color: #F6F4F4; | |
background-color: #f2f0f0; | |
background-image: -moz-linear-gradient(top, #f6f4f4, #edebeb); |
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
class CombinedIterator[A, B](first: Iterator[A], second: Iterator[B]) extends Iterator[(Option[A], Option[B])] { | |
def hasNext = first.hasNext || second.hasNext | |
def next = (if (first.hasNext) Some(first.next) else None, if (second.hasNext) Some(second.next) else None) | |
} |
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
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) | |
} |
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
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 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
for(i=0;++i<101;console.log([i,a='Fizz',b='Buzz',a+b][!(i%3)+2*!(i%5)])); |
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
// 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 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
#!/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 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
//;" | |
/*" | |
code = <<-CODE.chop | |
class AJavaClass { | |
public static void main(String[] args) { | |
System.out.println("#{Random.rand(100)}"); | |
} | |
} | |
CODE |
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
### | |
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 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 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); | |
} |