Skip to content

Instantly share code, notes, and snippets.

View casprwang's full-sized avatar

Casper Wang casprwang

View GitHub Profile
// two way to shorten an array
let s = '123456'
// reduce
// list => single num/string
let sum = [1, 2, 3, 4, 5].reduce((a, b) => a + b)
// list => a single num
let biggest = [...s].reduce((a, b) => Math.max(a, b))
// filter
.board {
display: flex;
width: 600px;
height: 600px;
flex-direction: row;
flex-wrap: wrap;
/* justify-content: flex-start; */
}
.square {
class Note extends React.Component {
constructor({age}) {
super()
// {age } = props.age
// this.age = {age}
this.age = {age}
}
componentDidMount(){
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
header {
background: purple;
/* eslint-disable */
import prompt from 'prompt';
import mkdirp from 'mkdirp';
import moment from 'moment';
import yaml from 'js-yaml';
/* eslint-enable */
import snakeCase from 'lodash/snakeCase';
import fs from 'fs';
prompt.start();
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom'
import React from 'react';
import moment from 'moment';
import './Timer.css'
class Timer extends React.Component {
constructor(props) {
super(props);
this.state = {
" ============================================================================
" ____ _ __ ___ _
" / ___| ___ _ __ __ _( )___ \ \ / (_)_ __ ___ _ __ ___ | |
" \___ \ / _ \| '_ \ / _` |// __| \ \ / /| | '_ ` _ \| '__/ __| | |
" ___) | (_) | | | | (_| | \__ \ \ V / | | | | | | | | | (__ |_|
" |____/ \___/|_| |_|\__, | |___/ \_/ |_|_| |_| |_|_| \___| (_)
" |___/
" ============================================================================
"
"
@-webkit-keyframes fadeIn { from { opacity:0; opacity: 1\9; /* IE9 only */ } to { opacity:1; } }
@-moz-keyframes fadeIn { from { opacity:0; opacity: 1\9; /* IE9 only */ } to { opacity:1; } }
@keyframes fadeIn { from { opacity:0; opacity: 1\9; /* IE9 only */ } to { opacity:1; } }
.fade-in {
opacity:0; /* make things invisible upon start */
-webkit-animation:fadeIn ease-in-out 1; /* call our keyframe named fadeIn, use animattion ease-in and repeat it only 1 time */
-moz-animation:fadeIn ease-in-out 1;
animation:fadeIn ease-in-out 1;
# in case tmux not working again
# sudo sysctl -w kern.tty.ptmx_max=256