Skip to content

Instantly share code, notes, and snippets.

View aneurysmjs's full-sized avatar
💭
асинхорнный

Аневризма aneurysmjs

💭
асинхорнный
View GitHub Profile
@bmaupin
bmaupin / epub.css
Last active January 27, 2022 15:31
You Don't Know JS Ebooks
body {
text-align: justify;
}
code, pre {
font-family: "DejaVuSansMono", monospace;
}
h1, h2, h3, h4, h5, h6 {
text-align: left;
@davideast
davideast / SyncPath.js
Last active April 20, 2021 17:19
Firebase Social Network Client Fanout
export class SyncPath {
constructor(rootRef, path) {
this._rootRef = rootRef;
this.user = this._rootRef.getAuth();
this._userDataRef = this._rootRef.child(path).child(this.user.uid);
this.data = {};
this._userDataRef.on('value', (snap) => this.data = snap.val() || {});
}
keys() {
return Object.keys(this.data);
@littleiffel
littleiffel / infinitescroll.js
Last active April 14, 2019 09:17
My directive for infinite scroll
app.directive('infiniteScroll', [
'$rootScope', '$window', '$timeout', function($rootScope, $window, $timeout) {
return {
link: function(scope, elem, attrs) {
var checkWhenEnabled, handler, scrollDistance, scrollEnabled;
$window = angular.element($window);
elem.css('overflow-y', 'scroll');
elem.css('overflow-x', 'hidden');
elem.css('height', 'inherit');
scrollDistance = 0;