Skip to content

Instantly share code, notes, and snippets.

View shawnmitchell's full-sized avatar

Shawn Mitchell shawnmitchell

View GitHub Profile
@asciimike
asciimike / Chat.rules
Created August 20, 2018 18:46
Firebase Pro Series "Pro Chat" secure chat app (from http://youtu.be/oFlHzF5U-HA)
function isChatMessage(message) {
return message.size() == 4
&& message.username is string
&& message.userId is string
&& message.createdAt is timestamp
&& message.messageText is string
&& message.messageText.size() <= 160;
}
function isUser(user) {
@johnpolacek
johnpolacek / gist:3827270
Last active January 20, 2023 15:46
Prevent FOUC
<!-- Prevent FOUC (flash of unstyled content) - http://johnpolacek.com/2012/10/03/help-prevent-fouc/ -->
<style type="text/css">
.no-fouc {display: none;}
</style>
<script type="text/javascript">
document.documentElement.className = 'no-fouc';
// add to document ready: $('.no-fouc').removeClass('no-fouc');
</script>