Skip to content

Instantly share code, notes, and snippets.

View markrowi's full-sized avatar

Mark Rowi Dizon markrowi

View GitHub Profile
@markrowi
markrowi / getFoodPandaMonthExpense
Last active September 2, 2022 01:09
Food Panda Monthly Expense
getFoodPandaMonthExpense = (month, year) => {
const temp1 = document.querySelectorAll('.order-item-container')
const fpOrders = []
temp1.forEach(a =>
fpOrders.push([
a.querySelector('.order-date').textContent,
a.querySelector('.item-price').textContent,
a.querySelector('[data-testid=NEXTGEN_CART_SUBTOTAL]').textContent,
a.querySelector('.overlay-text')?.textContent
import React from 'react';
import PropTypes from 'prop-types';
import Dialog from 'material-ui/Dialog';
import UseInput from '../CustomHooks/useInput';
export default function UseLoader({ open }) {
const { state: isLoading, onChange: setLoading } = UseInput(false);\
React.useEffect(() => { setLoading(open); }, [open]);
return (
<span className="LOADER">
@markrowi
markrowi / dashboard.js
Created July 28, 2020 05:48
PropertyHub
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
import PropTypes from 'prop-types';
import _ from 'lodash';
import Dialog from 'material-ui/Dialog';
import { fetchActiveAggregators } from 'Actions/actionAggregator';
@markrowi
markrowi / CachedLayer.js
Created January 9, 2020 08:17 — forked from jukben/CachedLayer.js
Custom Layer for react-leafleat with naive cache mechanism
import { withLeaflet, GridLayer } from "react-leaflet";
import L from "leaflet";
class Grid extends GridLayer {
createLeafletElement() {
const { url, cacheName } = this.props;
const Layer = L.TileLayer.extend({
createTile: (coords, done) => {
const { x, y, z } = coords;
@markrowi
markrowi / RecursionToLowerCaseAllTextInObject.js
Last active June 13, 2019 03:26
example of recursion - Lower case all text in a object
recur = (val) => {
let temp = {}
for(const i of Object.keys(val)) {
temp[i] = typeof val[i]==='object' ? recur(val[i]) : val[i].toLowerCase();
}
return temp;
}
// Enable component-scanning and auto-configuration with @SpringBootApplication Annotation
// It combines @Configuration + @ComponentScan + @EnableAutoConfiguration
@SpringBootApplication
public class FooApplication {
public static void main(String[] args) {
// Bootstrap the application
SpringApplication.run(FooApplication.class, args);
}
}
class Reservation extends React.Component {
constructor(props) {
super(props);
this.state = {
isGoing: true,
numberOfGuests: 2
};
this.handleInputChange = this.handleInputChange.bind(this);
}
@markrowi
markrowi / refs.jsx
Last active November 28, 2017 05:06
var Input = (props)=>{
if (props.inp){
return (<h1>
<strong>Method</strong><br/>
<input type="text" ref={input=>input&&input.focus()} name="" id="" onChange={props.rrender}/></h1>)
} return ""
}
//Rextester.Program.Main is the entry point for your code. Don't change it.
//Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace Rextester
{
@markrowi
markrowi / js
Created October 6, 2017 06:12
Beautiful Line Effects with Color Changes
//Forked from http://andreasstorm.com/
//Made by Bogden
//CANVAS
$(function(){
var canvas = document.querySelector('canvas'),
ctx = canvas.getContext('2d')
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
ctx.lineWidth = .3;