Skip to content

Instantly share code, notes, and snippets.

View grovertb's full-sized avatar
🏠
Working from home

GroverTB grovertb

🏠
Working from home
View GitHub Profile
@grovertb
grovertb / app.js
Created August 20, 2021 20:58
Fade In - scroll example
import React from 'react'
import clsx from 'clsx'
import { AppBar, Toolbar, Link, Container, IconButton, Typography, Divider, Grid, Button, TextareaAutosize, Drawer } from '@material-ui/core'
import {
Menu as MenuIcon,
Close as CloseIcon
} from '@material-ui/icons'
import useStyles from './style'
@grovertb
grovertb / ts.tsx
Created September 16, 2019 21:54
ts props
import React, { Component } from 'react';
// import React from 'react'
// interface Props {
// disableFocusRipple?: boolean;
// fullWidth?: boolean;
// href?: string;
// size?: 'small' | 'medium' | 'large';
// variant?: 'text' | 'outlined' | 'contained';
// }
@grovertb
grovertb / mediaRecorderAndroid
Created April 4, 2019 21:47
mediaRecorderAndroid
// int random = new Random().nextInt();
// String fileName = Environment.getExternalStorageDirectory().getPath() + "/Movies/video_" + random + ".mp4";
//
// mediaRecorder = new MediaRecorder();
// mediaRecorder.setCamera(camera); // This camera object got fromCustomVideoCapturer
// mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
// mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
const chunksPrefetch = extractor.chunks.concat(extractor.entrypoints)
const assetsPrefetch = extractor.getChunkChildAssets(chunksPrefetch, 'prefetch')
const linksPrefetch = assetsPrefetch.map(({chunk, linkType, scriptType, url, type}) => (
`<link ${type === 'mainAsset' ? 'data-chunk' : 'data-parent-chunk'}="${chunk}" rel="${linkType}" as="${scriptType}" href="${url}">`
))
SELECT ccc.id, ccc.name,ccc.is_visibility,ccc.is_active, ccs.path, ccc.parent_id, sum(auxPro.stock)
FROM tienda1.categories_category ccc
inner join tienda1.categories_categoryseo ccs on ccc.seo_id = ccs.id
inner join tienda1.products_productcategory ppc on ccc.id = ppc.category_id
inner join (
select cs1.id, CAST(MAX(cs1.stock) as INT) stock
from (
select pr.id, pr.product_type, vi.value as stock, vb.value as is_visibility
from tienda1.products pr
inner join tienda1.product_attributes pa on pr.id = pa.product_id
@grovertb
grovertb / crassa-root-prod.js
Created November 28, 2018 23:22
crassa-root-prod.js
import React, { Component, Fragment } from 'react'
import PropTypes from 'prop-types'
import { Provider, connect } from 'react-redux'
// import { SheetsRegistry } from 'jss'
// import JssProvider from 'react-jss/lib/JssProvider'
// import createGenerateClassName from '@material-ui/core/styles/createGenerateClassName'
// import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider'
// import createMuiTheme from '@material-ui/core/styles/createMuiTheme'
@grovertb
grovertb / crassa-universal-material.js
Created November 28, 2018 23:22
crassa-universal-material.js
import fs from 'fs'
import React, { Fragment } from 'react'
import { renderToString } from 'react-dom/server'
import { getLoadableState } from 'loadable-components/server'
import jsan from 'jsan'
import Helmet from 'react-helmet'
import createServerStore from './store'
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
StyleSheet,
Text,
function getTime() {
now = new Date();
fecha = new Date("2017-10-30 00:00:00");
diffDate = (fecha - now)
months = diffDate / 1000 / 60 / 60 / 24 / 30;
monthsRound = Math.floor(months);
days = diffDate / 1000 / 60 / 60 / 24 - (30 * monthsRound);
daysAux = diffDate / 1000 / 60 / 60 / 24;
Prereq:
apt-get install zsh
apt-get install git-core
Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
and then you change your shell to zsh
chsh -s `which zsh`