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
.container { | |
background: #f00; | |
width:50px; | |
height: 50px; | |
} | |
.container:before { | |
content: " "; | |
display: block; | |
background:#fff; |
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
video { | |
min-width: 100%; | |
min-height: 100%; | |
position: fixed; | |
left: 0; | |
top: 0; | |
z-index: -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
.my-fixed-item { | |
-webkit-backface-visibility: hidden; | |
-webkit-transform: translateZ(0); | |
} |
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
html,body { | |
/* this fix background images with fixed positioning */ | |
overflow-x:hidden | |
} |
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
window.addEventListener('scroll', function (e) { | |
// unfortunately this will never fire | |
console.log('we are scrolling!'); | |
}, false); | |
document.querySelector('body').addEventListener('scroll', function (e) { | |
// this one will fire though | |
console.log('yay!'); | |
}, false); |
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 body = document.querySelector('body'); | |
body.scrollTop = 100; | |
console.log(body.scrollTop); // 0 :( |
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
// quick and dirty check for webkit, which has a bug that it does not compute the | |
// proper scrollTop, when overflowX is set on the body. We can use this to decide | |
// when we have to disable fixed-attachment backgrounds, because they lead to a rendering | |
// issue in webkit. This test is just a naive implementation and probably could be improved | |
// but works fine for now. | |
var overflowScrollTopBuggy = function overflowScrollTopBuggy () { | |
if (testFixedBackgrounds.buggy) { | |
return testFixedBackgrounds.buggy; | |
} | |
var body = document.querySelector('body'); |
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
// this works fine | |
render: function() { | |
var content = []; | |
if (this.state.showResults && this.props.results.length) { | |
content.push(<ResultList results={this.props.results} onResultSelectAction={this.onResultSelectAction} />); | |
} | |
return ( | |
<div className="searchbox-wrapper"> |
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 Backbone = require('backbone'); | |
var _ = require('lodash'); | |
// extend `Backbone.AssociatedModel` with a create method, which will be | |
// used to create new models for us, instead of using `new` | |
// shamelessly inspired by Supermodel | |
var Cached = Backbone.AssociatedModel.extend({ | |
_cached: false, | |
_ref: 0, | |
ref: function () { |
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
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json) | |
RETURNS json | |
LANGUAGE sql | |
AS $$ | |
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json | |
FROM ( | |
SELECT * FROM json_each(data) | |
UNION ALL | |
SELECT * FROM json_each(insert_data) | |
) t; |
OlderNewer