This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import get from 'lodash/get'; | |
import EmptyListPlaceholder from './list/EmptyListPlaceholder'; | |
import Loading from './list/Loading'; | |
import './list/List.scss'; | |
interface Props<T> { | |
className?: string; | |
grid?: boolean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component, CSSProperties } from 'react'; | |
export interface Props { | |
'className'?: string; | |
'style'?: CSSProperties; | |
'src': string; | |
'data-src': string; | |
[key: string]: any; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Hammer from 'hammerjs'; | |
import './Gallery.scss'; | |
interface Props<T> { | |
sensitivity?: number; | |
slides: T[]; | |
template: (slide: T) => JSX.Element; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.my-cell { | |
position: relative; | |
height: 64px; | |
width: 100%; | |
margin-top: 1rem; | |
margin-bottom: 1rem; | |
.my-cell-content { | |
position: absolute; | |
top: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function refresh(dispatch: Dispatch, getState: () => MyState): Promise<void> { | |
const { auth: { authenticated, refresh_token: refresh } } = getState(); | |
if (!authenticated) | |
return; | |
try { | |
const { access_token, refresh_token, token_type } = await (async () => { | |
const res = await fetch(`${baseUrl}/oauth2/token`, { | |
method: 'POST', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { connect } from 'react-redux'; | |
import uuid from 'uuid/v4'; | |
import { baseUrl } from '../../environment.json'; | |
import { MyState, MyThunkDispatch } from '../../typings/state'; | |
import { User } from '../../typings/user'; | |
type Type = | |
'avatar' | | |
'item' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// accepts cell phone numbers like 091345876 and allows for spacing every three numbers | |
// accepts landline numbers like 26230945 (optional spacing 2 623 09 45) | |
const phone = /^((09[1-9](\s?)([0-9]{3})(\s?)([0-9]{3}))|((2|4)(\s?)([0-9]{3})(\s?)([0-9]{2})(\s?)([0-9]{2})))$/g; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using FindMe; | |
namespace TestProj | |
{ | |
class Program | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RectangleFinder where | |
import Prelude hiding ((*)) | |
import qualified Data.Map as Map | |
type Point = (Int, Int) | |
countRects :: [Point] -> Int | |
countRects pts = fst $ foldl processPoints (0, Map.empty) $ filter isAbove $ pts * pts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int max(int a, int b) { | |
return a > b ? a : b; | |
} | |
int max_profit(int* values, size_t len) { | |
if (len == 1) return 0; | |
int ret = 0; |