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
{ "_type": "login" } |
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
String.Format("mavia-metrics-{0}", guid); |
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
http://api.mysite.com/UserInfo/<MethodName> | |
http://api.mysite.com/CarInfo/<MethodName> |
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
# Get the determinant of a line and a point. This is conceptually | |
# represented by the following: | |
# | |
# point = (a,b) | |
# line = [(x1, y1), (x2, y2)], such that y2 > y1 | |
# | |
# matrix: | |
# | (x2 - x1) (a-x1) | | |
# | (y2 - y1) (b-y1) | | |
# |
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
# get all of the necessary tools to build | |
sudo yum install gcc-c++ llvm llvm-devel perl wget | |
# following rust-lang.org's instructions | |
wget http://dl.rust-lang.org/dist/rust-0.3.tar.gz | |
tar -xzf rust-0.3.tar.gz | |
cd rust-0.3 | |
./configure | |
make -j 4 && make install |
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
import sbt._ | |
import sbt.Keys._ | |
object MyPlugin extends AutoPlugin { | |
override lazy val projectSettings: Seq[Setting[_]] = Seq( | |
resourceDirectory in Compile := file("/tmp") | |
) | |
} | |
object MyBuild extends Build { |
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
struct MyStruct { | |
mut count : int | |
} | |
impl MyStruct { | |
fn inc(&mut self) -> () { (*self).count += 1; } | |
} | |
fn main() -> () { | |
let STAT : MyStruct = MyStruct { count: 1 }; |
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
Pinatra::after('*', function () { | |
Logger::log_request('served yet another request'); | |
}); |
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
struct Bob { | |
priv name : ~str, | |
priv age : int | |
} | |
impl Bob { | |
fn new(name: ~str, age: int) -> Bob { | |
Bob { name: name, age: age } | |
} |
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 str = "hello world"; | |
// Split on the empty character (between every | |
// letter). | |
var str_split = str.split(''); // => ['h', 'e', 'l', 'l', ' ', 'w', 'o', 'r', 'l', 'd'] | |
// reverse the resulting array | |
var str_reverse = str_split.reverse(); // => ['d', 'l', 'r', 'o', 'w', ' ', 'l', 'l', 'e', 'h'] | |
// join each string in the array, delimited by |