Skip to content

Instantly share code, notes, and snippets.

View matyax's full-sized avatar

Matias Chomicki matyax

View GitHub Profile
@matyax
matyax / Climbing the leaderboard.md
Created May 29, 2021 19:56
Solución: Climbing the Leaderboard

Solución: Climbing the Leaderboard

URL: https://www.hackerrank.com/challenges/climbing-the-leaderboard/problem

Lo había intentado antes y me había trabado siempre en el mismo lugar: timeout con inputs grandes. Probé casi las mismas "optimizaciones" que antes ("cache", pseudo búsqueda binaria) pero siempre daba timeout. Finalmente me inspiré: las posiciones en la tabla equivalen al índice del array de puntajes ordenado de manera decreciente, más uno.

TL;DR: el problema no era complejo, solamente había que eliminar los puntajes duplicados para tener rápidamente

@matyax
matyax / Summary
Created March 5, 2020 01:01
Errors with testing-library/react@beta
TypeError: MutationObserver is not a constructor
at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait.js:35:22
at wait (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait.js:28:10)
at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait.js:67:54
at node_modules/@testing-library/react/dist/pure.js:51:22
at batchedUpdates$1 (node_modules/react-dom/cjs/react-dom.development.js:24353:12)
at act (node_modules/react-dom/cjs/react-dom-test-utils.development.js:1090:14)
at asyncAct (node_modules/@testing-library/react/dist/act-compat.js:118:12)
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:50:35)
at waitWrapper (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait.js:67:35)
@matyax
matyax / chill.js
Created January 9, 2019 14:08
Slow down Protractor execution
var origFn = browser.driver.controlFlow().execute;
browser.driver.controlFlow().execute = function() {
var args = arguments;
// queue 100ms wait
origFn.call(browser.driver.controlFlow(), function() {
return protractor.promise.delayed(100);
});
@matyax
matyax / Pizza con masa madre.txt
Created June 27, 2017 14:41
Pizza masa madre
Masa pizza con MM
Les dejo la receta para hacer una rica masa de pizza con masa madre.
La fórmula es:
100% harina 000
62% agua
2% sal
0.5% levadura
1.1% aceite de oliva
@matyax
matyax / form.scss
Last active January 18, 2017 13:06
Form classes
@import './theme.scss';
.er-form {
}
.er-form__header {
}
.er-form__title {
@matyax
matyax / webpack.config.dev.js
Created August 31, 2016 15:59
Webpack development config file
var path = require('path'),
webpack = require('webpack'),
HtmlWebpackPlugin = require('html-webpack-plugin'),
OpenBrowserPlugin = require('open-browser-webpack-plugin'),
ExtractTextPlugin = require('extract-text-webpack-plugin'),
precss = require('precss'),
autoprefixer = require('autoprefixer'),
DashboardPlugin = require('webpack-dashboard/plugin');
mockMode = false;
@matyax
matyax / angular-boilerplate.js
Last active April 26, 2016 16:30
Angular 1.x boilerplate
/**
* Module definition
* Usage:
* <body ng-app="moduleName">...
*/
angular.module('moduleName', [ ])
.config(function(...) {
//custom config for this module if necessary
});
{
// Details: https://github.com/victorporof/Sublime-JSHint#using-your-own-jshintrc-options
// Example: https://github.com/jshint/jshint/blob/master/examples/.jshintrc
// Documentation: http://www.jshint.com/docs/
"browser": true,
"esnext": true,
"globals": {
"angular": true,
"jQuery": true,
"$": true,
# Bizarre
A Serbian Film
Human Centipede 2
Taxidermia
# Sci Fi
Ex Machina