obj = (function() {
currentValue = 7
return {
valueOf: function() { return currentValue = currentValue+2 }
}
})()
(obj < 10) && (obj > 10) //true
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
/ invalid | |
%div | |
%span | |
%span | |
%span{ | | |
"foo" => "bar", | | |
"baz" => 'quz' } | |
/ valid | |
%div |
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
Query = {} | |
Query.new = function() { | |
var queryAttributes = { | |
filters: [], | |
beginDate: null, | |
endDate: null, | |
attribute: null | |
} |
bar foo
I hereby claim:
- I am raorao on github.
- I am raorao (https://keybase.io/raorao) on keybase.
- I have a public key whose fingerprint is 2B05 C1E8 A751 C8FF DE93 20B6 CC2B F1A1 2EC2 F87E
To claim this, I am signing this object:
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
// how I used to write sass! | |
// ----------------------- | |
// its short, sure, but short doesn't necessarily mean simple. Its very difficult for me | |
// to tell how a given element gets its styles -- element-1 is getting inherited styles | |
// from its container, and then has two different explicit selectors. At scale, | |
// its even harder to tell what overrides what, and file ordering begins to actually | |
// matter. Whenever I see code like this now, I refactor it asap -- before | |
// it gets too unwieldy and brittle to change. | |
.container-element | |
font: 15px verdana |
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
GroceryList.start | |
GroceryList.next | |
# nil | |
GroceryList.add("a gallon of milk") | |
# :ok | |
GroceryList.next | |
# "a gallon of milk" |
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
defmodule RequestCache do | |
@moduledoc """ | |
Simple GenServer-based cache. | |
""" | |
use GenServer | |
@type t :: %{cache: %{optional(cache_key) => cache_value}, interval: integer} | |
@typep cache_key :: any | |
@typep cache_value :: any |
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
defmodule RequestCache do | |
@moduledoc """ | |
Simple ETS-based cache. | |
""" | |
use GenServer | |
@type t :: %{ttl: integer, invalidators: %{}} | |
@type cache_key :: any | |
@type cache_value :: any |
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
<html> | |
<body> | |
<style> | |
td { | |
border: 1px solid black; | |
width: 40px; | |
height: 40px; | |
} | |
</style> |