"~> 2.1" is identical to ">= 2.1 and < 3.0"
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 coffescript | |
some_object = { 'foo', 'bar' } | |
// generates this javascript | |
some_object = { | |
'foo': 'foo', | |
'bar': 'bar' | |
}; |
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
jruby-1.7.8 ~/projects/csscss-rb (master) ∴ time JAVA_OPTS='-Xms2g -Xmx2g' csscss -n 5 https://cache.harvestapp.com/assets/screen.css > /dev/null | |
real 0m34.301s | |
user 0m55.226s | |
sys 0m1.519s | |
jruby-1.7.8 ~/projects/csscss-rb (master) ∴ java -version | |
java version "1.7.0_45" | |
Java(TM) SE Runtime Environment (build 1.7.0_45-b18) | |
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode) |
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
# in ./config/spring.rb (or ~/.spring.rb) | |
module Spring | |
module Commands | |
class M | |
def env(*) | |
"test" | |
end | |
def exec_name | |
"m" |
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 parsing | |
import scala.util.parsing.combinator._ | |
object CSS extends RegexParsers { | |
sealed abstract class CSSTerms | |
case class Declaration(property:String, value:String) extends CSSTerms | |
case class Ruleset(selector:String, declarations:List[Declaration]) extends CSSTerms | |
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 parsing | |
import scala.util.parsing.combinator._ | |
object Arith extends JavaTokenParsers { | |
def expr: Parser[Double] = term ~ rep("+"~term | "-"~term) ^^ { | |
case term ~ list => (term /: list) { | |
case (x, "+" ~ y) => x + y | |
case (x, "-" ~ y) => x - y | |
} |
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
{-# LANGUAGE OverloadedStrings #-} | |
module Development.CSSCSS.RedundancyCalc where | |
import Data.Text (Text) | |
import Data.List | |
import Data.Map (fromListWith, toList) | |
import Development.CSSCSS.Rulesets |
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/env ruby | |
raise "need a file name" unless ARGV[0] | |
contents = File.read(ARGV[0]) | |
326_000.times do |i| | |
contents[(i + 23) % contents.size] | |
end |
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
data LengthUnit = PX | EM | EX | EN | |
deriving (Eq, Show, Ord) | |
data HorizontalPoint = LeftPoint | RightPoint | HorizontalCenter | |
deriving (Eq, Show, Ord) | |
data VerticalPoint = TopPoint | BottomPoint | VerticalCenter | |
deriving (Eq, Show, Ord) | |
data Length = Percent Number | Length {getLength :: Number, getLengthUnit :: LengthUnit} |
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
bg :: Parser Background | |
bg = do color <- try bgColor | |
image <- try bgImage | |
return $ Background color image |