- I prefer projects to be four space indents, though you can convince me to use tabs if we're starting a project together.
- Opening brackets do not belong on their own line.
- Spaces go on both sides of operators, always.
- Spaces never go on the inside of parenthesis except for curly braces of single line functions.
- That said, single line function expressions/declarations should be avoided. Mostly their usecase is IRC.
- irc://irc.mibbit.net/havvy
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
| let describe = macro { | |
| rule { $name:lit { $body ... } } => { | |
| describe($name, function () { | |
| $body ... | |
| }); | |
| } | |
| } | |
| let it = macro { | |
| rule { $name:lit { $body ... } } => { |
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
| On different axies. | |
| Two concepts that are orthogonal can be used (or happen) with or without each other freely, | |
| and do not affect each other. | |
| For a geometric example, perpendicular lines are orthogonal. | |
| For a general example, the metric system and the imperial system are orthogonal. While they | |
| are not usually used together, there is nothing wrong with saying millipounds or kilofeet. | |
| On the other hand, the imperial system and SI Units are not orthogonal. SI uses 'meters' where |
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
| fn main () { | |
| use std::vec_ng::Vec; | |
| let mut a_vec: Vec<int> = Vec::new(); | |
| a_vec.push(0); | |
| a_vec.push(1); | |
| a_vec.push(2); | |
| let a_str: ~str; |
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
| macro commaBetweenRules { | |
| rule { a } => { "a" }, | |
| rule { b } => { "b" } | |
| } |
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
| var forEachDelayed = function recur (array, fn, delay, ix) { | |
| ix = (typeof ix === "number") ? ix : 0; | |
| fn(array[ix], ix, array); | |
| if (ix === array.length - 1) { return; } | |
| setTimeout(function () { | |
| recur(array, fn, delay, ix + 1); | |
| }, delay); | |
| }; |
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
| # Configuration file | |
| "tinker's construct addon: iguana tweaks for tinkers construct" { | |
| # Stuff used for debugging. You probably don't want this. | |
| B:Debug=false | |
| # Modify tool and item mining levels to create a tiered-ish progression | |
| B:HarvestLevelTweaks=false | |
| # All the Items Iguana Tweaks for TConstruct adds (Clay Buckets,...) |
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
| // Given a phone number (array of 10 digits), find all alphabetical permutations using the following digit mapping. | |
| // Dont look up the answer, that ruins the fun! | |
| var digitMap = { | |
| 0: ['0'], | |
| 1: ['1'], | |
| 2: ['a','b','c'], | |
| 3: ['d','e','f'], | |
| 4: ['g','h','i'], | |
| 5: ['j','k','l'], |
This file has been truncated, but you can view the full file.
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
| installing ‘cargo-2015-05-13’ | |
| installing ‘rustRegistry-2015-05-19-6280837’ | |
| installing ‘rustc-1.0.0’ | |
| these derivations will be built: | |
| /nix/store/z1l9b79d34sqjvasygr2w0jjz0whgwnb-mirrors-list.drv | |
| /nix/store/vys3a7x9nmkx6vax2ax9c1qngqdcsxq5-rust-stage0-2015-03-27-5520801-linux-x86_64-ef2154372e97a3cb687897d027fd51c8f2c5f349.tar.bz2.drv | |
| /nix/store/1bynbqdg4fxyhvzkxf4v8v3gsi128jrj-rust-stage0.drv | |
| /nix/store/gxh2695ccgi3prc2i6b6yi7nzph3sgkx-stdenv-linux-boot.drv | |
| /nix/store/zp6pjvsigb2fzyjh8vs6gm9p1phykcva-bootstrap-glibc.drv | |
| /nix/store/jy41xsg5b1897bd23md3xfhvsg1pj7hg-bootstrap-gcc-wrapper.drv |
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
| use std::fmt; | |
| enum FizzBuzz { | |
| Fizz, | |
| Buzz, | |
| } | |
| impl fmt::Display for FizzBuzz { | |
| fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | |
| match self { |