Skip to content

Instantly share code, notes, and snippets.

View luggage66's full-sized avatar

Donald Mull Jr. luggage66

View GitHub Profile
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { accessor } from 'react-big-calendar/lib/utils/accessors';
import { accessor as accessorPropType } from 'react-big-calendar/lib/utils/propTypes';
import { noop } from 'lodash';
import { zonedToLocal, localToZoned } from '/client/utils/timezones';
import { hasTime, shiftDate, shiftHour } from '/client/utils/date';
/**
* withTimeZone - HOC to add time zone support to react-big-calendar
@rlemon
rlemon / canned.js
Last active April 25, 2018 18:00
const KEYWORD_MAP = {};
/*
KEYWORD_MAP[<user_id>][<term>] returns the reply
*/
KEYWORD_MAP[774078] = {
'jesus': 'https://i.imgur.com/6Vv7kyL.png'
};
KEYWORD_MAP[617762] = {
'BAM!' : 'SPACE GUN!'
};
@afonsomatos
afonsomatos / ModulesES6.js
Last active August 29, 2015 14:23
Importing and exporting modules in es6
// --- All ways to import a module (main.js)
import MyDefault from './m1';
import { square, diag } from './m1'
import { square as sq, diag as dg} from './m1'
import * as lib from './m1'
import { default as foo } from './m1'
import Animal from './m1';
import './m1' // loads the module (executes the body)
// but doesn't import anything
import MyDefault, * as lib from './m1'
@Zirak
Zirak / helloWorld.js
Last active January 21, 2021 18:18
The Hello World of the future
/*
* The Hello World of tomorrow
* Copyright (C) 2012 Scruffy
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@psebborn
psebborn / countCSSRules.js
Last active April 25, 2023 11:43
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {