Skip to content

Instantly share code, notes, and snippets.

View smarquez1's full-sized avatar
👨‍💻

Sergio Marquez smarquez1

👨‍💻
View GitHub Profile
// eslint-disable no-console
// https://github.com/facebook/react/pull/22114#issuecomment-900721521
// This error is a bug fixed in React 18: https://github.com/facebook/react/pull/22114.
// Suppress it for all tests.
const KNOWN_VIOLATIONS = [
"Warning: Can't perform a React state update on an unmounted",
];
@smarquez1
smarquez1 / response.json
Created November 2, 2023 19:06
response.json
{
"id": 1,
"user_id": 1,
"estimate_id": 3,
"query": "test",
"status": "success",
"message": "",
"job_status": "success",
"operations": [
{
@smarquez1
smarquez1 / page.js
Created October 4, 2018 15:15
Page specific javascript on Rails
//Based on https://www.driftingruby.com/episodes/page-specific-javascript-in-ruby-on-rails#comments
// Usage:
// if(!page.isControllerAndAction('users', 'index')) return;
var Page, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
Page = (function() {
function Page() {
this.action = bind(this.action, this);
this.controller = bind(this.controller, this);