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
import SimpleBarReact from 'simplebar-react'; | |
import { FixedSizeList } from 'react-window'; | |
import React from 'react'; | |
const FixedSizeListSimpleBar: React.FC<typeof FixedSizeList & { | |
className?: string; | |
height?: number; | |
children: React.ReactNode; | |
}> = ({ | |
className, |
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
'use strict'; | |
const fs = require('fs'); | |
const isWsl = require('is-wsl'); | |
const path = require('path'); | |
const webpack = require('webpack'); | |
const resolve = require('resolve'); | |
const PnpWebpackPlugin = require('pnp-webpack-plugin'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); |
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
/* | |
$(".some-selector").onAnimationEnd(function(animationName) { | |
console.log(" Will be called when any of the show or hide animations end."); | |
}, ["show", "hide"]); | |
*/ | |
$.fn.onAnimationEnd = function(callback, animationName) { | |
var animations = ["animationend", "oAnimationEnd", "MSAnimationEnd", "webkitAnimationEnd"]; | |
$(document).delegate(this.selector, animations.join(" "), function(e) { | |
var ev = e.originalEvent || e |
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
/* | |
Returns a nested property / executes a nested function from a variable, or a default value, without having it throwing any error | |
*/ | |
var safeVar = function(string, def) { | |
var properties = string.split("."); | |
var filtered = []; | |
try { | |
properties.forEach(function(property) { | |
filtered.push(property); |
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
/* | |
Takes any function with a callback as last parameter, and allow to add it another callback executed before it. Requires underscore. | |
Example: | |
Mongo.Collection.prototype.insert = extendWithCallback(Mongo.Collection.prototype.insert, function() { | |
console.log("This logs every time an insert is done on a collection, even though we did not explicitely declared a callback when calling insert"); | |
}); | |
var items = new Mongo.Collection("items"); |
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
/* | |
Prevents browsers from crashing with heavy loops | |
*/ | |
eachAsync = function(array, iterator, callback) { | |
var timeout = 0; | |
var counter = 0; | |
function process() { | |
iterator.apply && iterator.apply(this, [counter, array[counter]]); | |
counter += 1; | |
if (counter < array.length) { |
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
ERROR: Loading command: install (LoadError) | |
dlopen(/usr/local/Cellar/ruby/2.1.2_1/lib/ruby/2.1.0/x86_64-darwin14.0/openssl.bundle, 9): Symbol not found: _SSLv2_client_method | |
Referenced from: /usr/local/Cellar/ruby/2.1.2_1/lib/ruby/2.1.0/x86_64-darwin14.0/openssl.bundle | |
Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib | |
in /usr/local/Cellar/ruby/2.1.2_1/lib/ruby/2.1.0/x86_64-darwin14.0/openssl.bundle - /usr/local/Cellar/ruby/2.1.2_1/lib/ruby/2.1.0/x86_64-darwin14.0/openssl.bundle | |
ERROR: While executing gem ... (NoMethodError) | |
undefined method `invoke_with_build_args' for nil:NilClass |
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 loggedIn = false; | |
Meteor.autorun(function() { | |
var user = Meteor.user(); | |
if (user) { | |
if (!loggedIn) { | |
loggedIn = true; | |
/* Login callback */ | |
} | |
} else { | |
if (loggedIn) { |
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
Posts = new Mongo.Collection("posts"); | |
if (Meteor.isServer) { | |
Meteor.publish("posts", function(timeStamp) { | |
var selector = timeStamp ? { createdAt: { $gte: timeStamp }} : {}; | |
var options = timeStamp ? {} : { limit: 10, sort: { createdAt: -1 }}; | |
return Posts.find(selector, options); | |
}); | |
} |
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
UI.registerHelper('_', function() { | |
arguments = _.toArray(arguments); | |
var self = this, | |
fn = arguments[0]; | |
arguments.shift(); // Removes the Underscore function | |
arguments.pop(); // Remove the Spacebars appended argument | |
return _[fn].apply(self, arguments); | |
}); | |
/* |