Skip to content

Instantly share code, notes, and snippets.

View develohpanda's full-sized avatar
✌️
Chillin'

Opender Singh develohpanda

✌️
Chillin'
View GitHub Profile
@develohpanda
develohpanda / hoc-template.tsx
Created February 27, 2019 11:34 — forked from devdoomari3/hoc-template.tsx
Typescript higher order component (hoc) template
/* variation on https://medium.com/@DanHomola/react-higher-order-components-in-typescript-made-simple-6f9b55691af1 */
import * as React from 'react'
import { wrapDisplayName } from 'recompose'
// Props you want the resulting component to take (besides the props of the wrapped component)
interface ExternalProps {}
// Props the HOC adds to the wrapped component
export interface InjectedProps {}
@develohpanda
develohpanda / convert-UNIX-timestamp.js
Created May 21, 2017 09:54 — forked from kmaida/convert-UNIX-timestamp.js
Convert a UNIX timestamp to user's local time via JavaScript
function convertTimestamp(timestamp) {
var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds
yyyy = d.getFullYear(),
mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0.
dd = ('0' + d.getDate()).slice(-2), // Add leading 0.
hh = d.getHours(),
h = hh,
min = ('0' + d.getMinutes()).slice(-2), // Add leading 0.
ampm = 'AM',
time;