I hereby claim:
- I am vm on github.
- I am vignesh (https://keybase.io/vignesh) on keybase.
- I have a public key whose fingerprint is C3C9 96A7 21E5 3F81 89AC FFA8 3D1A 96A8 153B 1576
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
extern crate chrono; | |
use std::fmt; | |
use chrono::*; | |
enum Source { | |
Facebook(String), | |
SMS(usize), | |
Email(String) |
class Counter extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
counter: 0 | |
} | |
} | |
} | |
class CounterWithState extends React.Component { |
import { curry } from 'ramda' | |
const filter = curry((fn, xs) => { | |
ys = [] | |
for (let x of xs) { if (fn(x)) ys.push(y) } | |
return ys | |
}) | |
const xs = [1, 4, 3, 2] |
def accumulate_with_remainder(xs): | |
"""implements accumulate while also returning the remainder | |
>>> accumulate_with_remainder([1,2,3]) | |
[ | |
([], [1,2,3]), | |
([1], [2,3]), | |
([1,2], [3]), | |
([1,2,3], []) | |
] |
from functools import partial | |
from inspect import signature | |
def curry(func, _arglen=None): | |
"""creates a curried version of the given function | |
>>> add = lambda a, b: a + b | |
>>> assert add(1, 2) == curry(add)(1)(2) | |
True |
import signal | |
def timeout(seconds): | |
def wraps(fn): | |
def inner(*args, **kwargs): | |
def handler(signum, frame): | |
raise TimeoutError | |
signal.signal(signal.SIGALRM, handler) | |
signal.alarm(seconds) |
import React, { Component } from 'react' | |
const Timeline = ({ children }) => ( | |
<div style={{ display: 'flex', alignItems: 'center', flexDirection: 'column' }}> | |
{children.map(child => <div style={{ width: '16rem', padding: '1.4rem' }}>{child}</div>)} | |
</div> | |
) | |
const PostHeader = ({ authoredAt, author }) => ( | |
<div style={{ backgroundColor: '#e8fdf5', paddingTop: '1rem', paddingBottom: '1rem',fontSize: '875rem' }}> |
import csv | |
import xml.etree.ElementTree as ET | |
STAGING = True | |
domain = 'uniswap-staging.org' if STAGING else 'uniswap.org' | |
tree = ET.parse('sitemap-0.xml') | |
urlset = tree.getroot() |