Skip to content

Instantly share code, notes, and snippets.

View morgs32's full-sized avatar

Morgan Intrator morgs32

View GitHub Profile
@Brian-McBride
Brian-McBride / firebase-admin-jest-nx.md
Last active October 18, 2021 15:45
firebase-admin v10 with Jest 27 inside @nrwl/nx monorepo

firebase-admin + jest + nx

Using the new v10 firebase-admin libs with Jest v27 and Nx monorepos

Problem

Jest does not support the exports keyword within package.json fully. Proper support is expected in Jest 28

Will solve this error when updating to the new firebase-admin import methods

@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@martyndavies
martyndavies / rollup.sql
Created April 6, 2018 16:44
Example of a Postgres rollup
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,
// 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 April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

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 March 12, 2017 13:36 — forked from mbostock/.block
Zoomable Icicle (d3 v4)
license: gpl-3.0
@tamlyn
tamlyn / README.md
Last active July 7, 2022 09:48
Execution order of Jest/Jasmine test code

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 September 23, 2021 16:29
Until operator for Enzyme's shallow wrapper

Usage

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

const EnhancedFoo = compose(
  connect(...),
  withHandlers(...),
 withContext(...)
@chapati23
chapati23 / react-router-v4-page-transitions.jsx
Created November 8, 2016 22:41
React Router v4 Page Transitions
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 April 12, 2017 09:11 — forked from ThadeuLuz/mdStyleColor.js
Trying to add more flexibility to elements css in angular-material
(function () {
"use strict";
var _theme;
var _palettes;
angular
.module('mdColors',['mdColors'])
.config(['$mdThemingProvider', function($mdThemingProvider){