Skip to content

Instantly share code, notes, and snippets.

Morgan Intrator morgs32

Block or report user

Report or block morgs32

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@martyndavies
martyndavies / rollup.sql
Created Apr 6, 2018
Example of a Postgres rollup
View rollup.sql
CREATE OR REPLACE FUNCTION compute_5min_rollups(start_time TIMESTAMP, end_time TIMESTAMP)
RETURNS void LANGUAGE PLPGSQL AS $function$
BEGIN
EXECUTE $$
INSERT INTO rollups_5min
SELECT
date_trunc('seconds', (timestamp - TIMESTAMP 'epoch') / 300) * 300 + TIMESTAMP 'epoch' AS minute,
app_id,
timestamp,
count(*) AS query_count,
View data.js
// routes.js
const routes = [
{
path: '/',
component: Home,
exact: true
},
{
path: '/gists',
component: Gists
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active Jul 5, 2019
What I Wish I'd Known About Equity Before Joining A Unicorn
View what-i-wish-id-known-about-equity-before-joining-a-unicorn.md

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@tophtucker
tophtucker / .block
Last active Mar 12, 2017 — forked from mbostock/.block
Zoomable Icicle (d3 v4)
View .block
license: gpl-3.0
@tamlyn
tamlyn / README.md
Last active May 15, 2019
Execution order of Jest/Jasmine test code
View README.md

Execution order of Jest/Jasmine test code

While tests run in source order, surrounding code does not which can lead to hard to debug issues.

Compare the test file below with the sample output below that and note the order of the log messages.

Key points

  • Any code not inside of it, beforeAll, afterAll, beforeEach or afterEach runs immediately on initialisation.
    • This means code at the end of your file runs before even your before hooks.
@matthieuprat
matthieuprat / README.md
Last active May 23, 2019
Until operator for Enzyme's shallow wrapper
View README.md

Usage

import until from 'path/to/until'
import { shallow } from 'enzyme'

const EnhancedFoo = compose(
  connect(...),
  withHandlers(...),
  withContext(...)
View react-router-v4-page-transitions.jsx
import React from 'react'
import { TransitionMotion, spring } from 'react-motion'
import Router from 'react-router/BrowserRouter'
import Match from 'react-router/Match'
import Link from 'react-router/Link'
import Redirect from 'react-router/Redirect'
const styles = {}
styles.fill = {
@dh94
dh94 / mdStyleColor.js
Last active Apr 12, 2017 — forked from ThadeuLuz/mdStyleColor.js
Trying to add more flexibility to elements css in angular-material
View mdStyleColor.js
(function () {
"use strict";
var _theme;
var _palettes;
angular
.module('mdColors',['mdColors'])
.config(['$mdThemingProvider', function($mdThemingProvider){
@farnabaz
farnabaz / arrow.fabric.js
Created May 22, 2015
fabric.js arrow shape
View arrow.fabric.js
//
// Arrow for fabric.js
//
(function($){
$.Arrow = $.util.createClass($.Line, $.Observable, {
initialize: function(e,t) {
this.callSuper("initialize", e, t)
this.set({type:'arrow'});
},
_render: function(e) {
@bennadel
bennadel / ng-if-false.htm
Created Jan 12, 2015
Creating A Pre-Bootstrap Loading Screen In AngularJS
View ng-if-false.htm
<!-- BEGIN: Pre-Bootstrap Loading Screen. -->
<div ng-if="false">
<p>
This will show until the application is bootstrapped.
Then, the ngIf directive will immediately rip it out of
the page.
</p>
</div>
You can’t perform that action at this time.