Skip to content

Instantly share code, notes, and snippets.

View brunotavares's full-sized avatar

Bruno Tavares brunotavares

  • Meta
  • Los Angeles, CA
View GitHub Profile
@brunotavares
brunotavares / output.txt
Last active May 10, 2018 22:44
Test how pretty-format compares to React renderer
Input
<App />
React DOM rendering
<div></div>
Prettyprint rendering ReactElement
<App />
Prettyprint rendering ReactTestComponent
@brunotavares
brunotavares / react-native-double-tap.js
Last active June 4, 2022 17:14
Double tap gesture recognition for React Native.
const DOUBLE_PRESS_DELAY = 300;
// ...
/**
* Double Press recognition
* @param {Event} e
*/
handleImagePress(e) {
const now = new Date().getTime();
@brunotavares
brunotavares / ie-video-clone-bug.html
Last active August 29, 2015 14:23
IE <video> cloneNode() bug
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<script type="text/javascript">
// create a video node without auto-play
var originalVideoNode = document.createElement("video");
@brunotavares
brunotavares / route-login-idea.js
Created August 7, 2013 18:52
Help with scenario: User clicks link to /users/:id/edit, but they must authenticate at /login before the page is visible. Ideas?
//app/controller/Base.js
Ext.define('SenchaCon.controller.Base',{
extend: 'Ext.app.Controller',
/**
* If user already logged in, don't require login anymore.
* Otherwise, open the login modal.
*/
requireLogin: function() {
if (User.isLoggedIn) {