Skip to content

Instantly share code, notes, and snippets.

View sort.css
.table [data-sort]:after {
content: url("data:image/svg+xml;utf8,<svg width='6' height='10' viewBox='0 0 6 10' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M3 0L6 4H0L3 0ZM3 10L0 6H6L3 10Z' fill='%2395AAC9'/></svg>");
margin-left: .25rem
}
.table [data-sort="asc"]:after {
content: url("data:image/svg+xml;utf8,<svg width='6' height='10' viewBox='0 0 6 10' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M3 0L6 4H0L3 0ZM3 10L 10Z' fill='%2395AAC9'/></svg>");
}
.table [data-sort="desc"]:after {
View error404.js
import React from "react";
const Error404 = () => {
return (
<div
style={{
backgroundColor: "#111111",
position: "absolute",
top: 0,
bottom: 0,
View gist:3863102a09593c1d92db63de2c8326da
{
"extends": [
"airbnb",
"prettier",
"prettier/react"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {
View utils-date.js
export const formatToStandardDate = (unixTimeStamp, format) => {
// *1000 to convert unix timestamp in ms to s
const currentDate = new Date(unixTimeStamp*1000);
const mon=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
const fullMon=['January','February','March','April','May','June','July','August','September','October','November','December'];
const days=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
const fullDays=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
let regex=new RegExp("DDDD","g");
@codejets
codejets / throttle-react.js
Created Dec 12, 2017
Simple Throttle in React
View throttle-react.js
import React from 'react';
import { findDOMNode } from 'react-dom';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import throttle from 'lodash/throttle';
import { isHidden } from 'lib/dom';
import * as adActions from 'app/actions/ads';
import { TOP_NAV_HEIGHT } from 'app/constants';
@codejets
codejets / simpleDragnDrop.js
Last active Dec 9, 2017
Simple drag and drop
View simpleDragnDrop.js
import React from "react";
const styles = {
width: "200px",
border: '1px solid #222',
height: "200px",
display: "inline-block",
verticalAlign: "top",
background: "#fff"
};
@codejets
codejets / pie_test.csv
Last active Sep 20, 2017
pie_test.csv
View pie_test.csv
age population color
<5 2704659 #30343F
5-13 4499890 #FAFAFF
14-17 2159981 #E4D9FF
18-24 3853788 #273469
25-44 14106543 #87B37A
45-64 8819342 #E2D58B
≥65 612463 #F9D4BB
@codejets
codejets / mock-data.tsv
Last active Sep 20, 2017
mock-data.tsv
View mock-data.tsv
date New York San Francisco Austin
20111001 63.4 62.7 72.2
20111002 58.0 59.9 67.7
20111003 53.3 59.1 69.4
20111004 55.7 58.8 68.0
20111005 64.2 58.7 72.4
20111006 58.8 57.0 77.0
20111007 57.9 56.7 82.3
20111008 61.8 56.8 78.9
20111009 69.3 56.7 68.8
View Agile-Works.md

Agile Works!

Building and delivering Small modules in sprints over the whole application at once.

Agile Manifesto:

  1. Individuals and interactions over processes and tools
  2. Working Software over Comprehensive Document
  3. Customer Collaboration over Contract Negotiation
  4. Responding to change over initial plan
  5. Change of plan anytime during development
@codejets
codejets / random-hex-color
Created Nov 22, 2016
random hex color codes
View random-hex-color
Easily generate a random hex color in JS:
"#" + Math.floor(Math.random() * 16777215).toString(16).toUpperCase();