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
.main { | |
@include row; | |
} | |
.nav { | |
@include col-xs-3; | |
} | |
.body { | |
@include col-xs-9; | |
} |
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 domain = require('domain') | |
var d = domain.create(); | |
d.on('error', function(er) { | |
console.error('caught', er); | |
}); | |
d.run(function() { | |
console.log('HERE:1'); |
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
def load_hstore_coloumn | |
begin | |
load_hstore_as_rails4 | |
rescue | |
load_hstore_as_rails3 | |
end | |
end | |
def save_hstore_column | |
save_hstore_as_rails4 |
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
foo.bar(foo, { | |
success: () -> | |
baz() | |
do_success() | |
error: () -> | |
do_error() | |
}) |
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
<!DOCTYPE HTML> | |
<meta charset="UTF-8"> | |
<h1>Install multiple onload</h1> | |
<script> | |
window.addEventListener('load', function() { | |
alert('first onload'); | |
console.log('first onload'); | |
}); | |
</script> |
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
<div> | |
<!-- A: header table (not scrorablle) --> | |
<table> | |
<tr><th>ID</th></tr> | |
<tr><th>Name</th></tr> | |
<tr><th>Created at</th></tr> | |
<tr><th>Modified at</th></tr> | |
</table> | |
<!-- B: data table (scrorablle x and y axis --> |
When writing a regex patter like [a-zA-Z0-9_-]
which have -
in char class,
it is better that put -
at top. [-a-zA-Z0-9_]
If -
is put at last and after a character: [_-]
,
As a parser of regexp pattern, when met -
after _
(a literal character),
it can't be determined as a range operator or a literal character soon.
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
addDefaultHandlers: (options) -> | |
return _.extend({ | |
# common handler | |
error: (jqXHR, textStatus, errorThrown) => | |
console.log('NG', arguments) | |
success: (data, textStatus, jqXHR) => | |
console.log('OK', arguments) | |
}, options) | |
main: () -> |
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
def new_feature(id, values) | |
data = get_data(id) | |
if data.hasGoodValue? | |
data.updateByValues(values) | |
data.save() | |
else | |
showError() | |
end | |
end |
NewerOlder