Skip to content

Instantly share code, notes, and snippets.

View basekays's full-sized avatar

Hyejin Kay Albito basekays

View GitHub Profile
import {Button, Card, Form, Grid, Icon, Input, Message, Popup} from 'semantic-ui-react';
import CreditCardFormConstants from '../CreditCardFormConstants';
import ErrorMessage from './ErrorMessage';
import React, { Component } from 'react';
const {BUTTON_SUBMIT, CARD, DESCRIPTION, LABELS, PLACEHOLDERS} = CreditCardFormConstants;
const date = new Date();
const currentMonth = date.getMonth().toString();
const currentYear = date.getFullYear().toString();
const MinStack = function() {
this.items = [];
this.minValueTracker = [];
};
MinStack.prototype.push = function(x) {
const minValueTrackerLength = this.minValueTracker.length - 1;
const latestMinValue = this.minValueTracker[minValueTrackerLength];
this.items.push(x);
if (!this.minValueTracker.length) {
var MinStack = function() {
this.items = [];
this.auxItems = [];
};
MinStack.prototype.push = function(x) {
const firstAuxItem = this.auxItems[this.auxItems.length - 1];
this.items.push(x);
if (!this.auxItems.length) {
this.auxItems.push(x);
var missingNumber = function(nums) {
let sum = 0;
let expectedSum = nums.length;
for (var i = 0; i < nums.length; i++) {
sum += nums[i];
expectedSum += i;
}
return expectedSum - sum;
};
/**
* @param {number[]} nums
* @return {void} Do not return anything, modify nums in-place instead.
*/
var moveZeroes = function(nums) {
for (var i = nums.length; i >= 0; i--) {
if (nums[i] == 0) {
nums.splice(i, 1);
nums.push(0);
const homeList = [
{
id: '1',
name: 'a',
address: 'aaaaa',
photo: 'A',
description: 'AAA',
},
{
id: '2',
class Clock extends React.Component {
constructor(props) {
super(props);
this.state = {
date: new Date(),
}
}
comoponentDidMount() {
this.timerID = setInterval(
class TodoList extends React.Component {
constructor(props) {
super(props);
this.state = {
todoItems: [
'workout',
],
}
this.handleSubmit= this.handleSubmit.bind(this);
}
class Clicker extends React.Component {
constructor(props) {
super(props);
this.state = {
counter: 0,
}
this.onMinusClick = this.onMinusClick.bind(this);
this.onResetClick = this.onResetClick.bind(this);
this.onPlusClick = this.onPlusClick.bind(this);
this.onMinusTenClick = this.onMinusTenClick.bind(this);
/**
* @param {number} n
* @return {string}
**/
var countAndSay = function(number) {
var string = '1';
for (var i = 1; i < number; i++) {
var stringToArray = string.split('');
var counter = 1;