Skip to content

Instantly share code, notes, and snippets.

View nelsson's full-sized avatar

Nelson Villafuerte Orbezo nelsson

View GitHub Profile
@nelsson
nelsson / payment.js
Created April 30, 2020 05:11
Enable ionViewWillEnter in tabs ionic, https://github.com/ionic-team/ionic/issues/16834
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { IonTabs } from '@ionic/angular';
import { Subscription } from 'rxjs';
export interface Tab {
tabsWillEnter();
tabsDidEnter();
tabsWillLeave();
tabsDidLeave();
}
@nelsson
nelsson / questionsInWP.js
Last active March 30, 2020 18:55
in process
$ = jQuery.noConflict();
function menuRespuesta(id){
var htmlTextArea = '<div class="c-wrap-menu b1">'+
'<span class="c-open-menu">'+
'<span class="fa fa-caret-down"></span>'+
'</span>'+
'<div class="c-menu-desplegable">'+
'<h3 class="c-menu-title">Tipo de respuesta</h3>'+
'<ul class="c-menu-list">'+
import React, { useState, useCallback, useEffect } from 'react';
import Autosuggest from 'react-autosuggest';
import AutosuggestHighlightMatch from 'autosuggest-highlight/match';
import AutosuggestHighlightParse from 'autosuggest-highlight/parse';
import debounce from 'lodash.debounce';
import PropTypes from 'prop-types';
// function escapeRegexCharacters(str) {
// return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
// }
function resizePlayer(iframes, ratio) {
if (!iframes[0]) return;
var win = $(".b1"),
width = win.width(),
playerWidth,
height = win.height(),
playerHeight,
ratio = ratio || 16/9;
$(iframes).each(function(){
<script type="text/javascript">
$(function(){
function select(item, title, contenido){
$(item).eq(0).find(title).addClass('active');
$(item).eq(0).find(contenido).show();
$(title).click(function () {
if ($(this).hasClass('active')){
$(this).next(contenido).slideUp().css('height', 'auto');
FAIL packages/bah-admin/src/modals/ModalUserForm/UserRoles/UserRoles.test.js (6.1s)
● Console
console.warn node_modules/gsap/dist/gsap.js:93
Invalid Invalid scrollTo tween [object Object]. Missing plugin? gsap.registerPlugin() tween of undefined Missing plugin? gsap.registerPlugin()
● <UserRoles/> › renders without accessibility violations
expect(received).toHaveNoViolations(expected)
// buscador autocomplete
$.widget("custom.catcomplete", $.ui.autocomplete, {
_renderMenu: function(ul, items) {
var self = this,
currentCategory = "";
$.each(items, function(index, item) {
if (item.category != currentCategory) {
ul.append("<li class='ui-autocomplete-category g3-category-search'>" + item.category + "</li>");
currentCategory = item.category;
import React from 'react'
import makeStyles from '@material-ui/styles/makeStyles'
import Typography from '@material-ui/core/Typography'
import { c, f } from '@bah/ui/src/utils/theme'
import Autosuggest from 'react-autosuggest'
import AutosuggestHighlightMatch from 'autosuggest-highlight/match'
import AutosuggestHighlightParse from 'autosuggest-highlight/parse'
const people = [
{
first: 'Charlie',
@nelsson
nelsson / styled-componente.txt
Created November 27, 2019 03:08
Configuration Styled Component for project react with webpack
package:
"babel-plugin-styled-components": "^1.10.6",
"styled-components": "^4.4.1",
En src: create .babelrc
with:
{
"plugins": [
[
"styled-components",
import React from "react";
import {
FooterWrap,
Icon,
Lists,
ListsItem,
ListsLink,
ListsTitle,
ListsUl,
Social,