Skip to content

Instantly share code, notes, and snippets.

View mikerourke's full-sized avatar
🐺

Mike Rourke mikerourke

🐺
View GitHub Profile
@mikerourke
mikerourke / package.json
Last active October 27, 2020 20:26
Reference webpack configuration for an Electron application that uses TypeScript.
{
"name": "some-name",
"productName": "The Product",
"version": "1.0.0",
"main": "src/main/main.ts",
"author": "Biscuits O'Shea",
"license": "PRIVATE",
"private": true,
"scripts": {
"build": "webpack --mode production --progress",
@mikerourke
mikerourke / debt-prioritizer.f95
Last active October 27, 2020 20:54
Fortran Blog Post
program debt_prioritizer
implicit none
type debtor
character(len=:), allocatable :: name
integer :: debt
end type debtor
! Ugh! Global variables!?
! Originally, I was passing the "debtors" and "debtor_count"
@mikerourke
mikerourke / Cook the Books Data Loader
Last active August 22, 2018 15:59
API Setup for Cook the Books
var transactions = [
{
"id": 1000,
"transactionDate": "2017-08-02",
"toFrom": "Uncle Buck's Insurance",
"type": "Withdrawal",
"category": "Insurance",
"rawAmount": -1200,
"cookedAmount": -1000,
"description": "Insurance for business"
@mikerourke
mikerourke / move-redux-files.js
Created March 6, 2018 03:48
Refactoring Execution: Git Move Script
const fs = require('fs');
const path = require('path');
const chalk = require('chalk');
const sh = require('shelljs');
const _ = require('lodash');
const sourcePath = path.resolve(process.cwd(), 'src');
// This is the new /src/redux folder that gets created:
const reduxPath = path.resolve(sourcePath, 'redux');
@mikerourke
mikerourke / describe-block-structure.js
Created February 2, 2018 03:06
Refactoring Tests: Describe Block Structure
describe('Component A', () => {
describe('Snapshot validation', () => {
it('matches its snapshot with valid props', () => {
const { wrapper } = setup();
expect(wrapper).toMatchSnapshot();
});
});
describe('Event validation', () => {
it('fires props.onClick when button is clicked', () => {
@mikerourke
mikerourke / test-setup.js
Created February 2, 2018 03:03
Refactoring Tests: Establish Format
const setup = (propOverrides, renderFn = shallow) => {
const props = {
propA: 'Some Value',
propB: false,
onClick: jest.fn(),
...propOverrides,
};
const wrapper = renderFn(<AppComponent {...props} />);
@mikerourke
mikerourke / exports.zsh
Last active May 17, 2020 18:04
Learning How to Learn WebAssembly: Exports
# You can also add these to your .bash_profile file, just make sure
# you update the versions of anything that doesn't match (i.e. emscripten
# is version 1.37.14, but it may be different for you).
export EM_CONFIG="$HOME/.emscripten"
export EMSDK="$HOME/Tooling/emsdk"
export EM_CONFIG="$HOME/.emscripten"
export EMSCRIPTEN="$HOME/Tooling/emsdk/emscripten/1.37.14"
export BINARYEN_ROOT="$HOME/Tooling/emsdk/clang/e1.37.14_64bit/binaryen"
export PATH="$PATH:$HOME/Tooling/emsdk:$HOME/Tooling/emsdk/emscripten/1.37.14:$HOME/Tooling/emsdk/node/4.1.1_64bit/bin:$HOME/Tooling/emsdk/clang/e1.37.14_64bit"
@mikerourke
mikerourke / CMakeLists.txt
Last active August 15, 2017 20:23
Learning How to Learn WebAssembly: CMakeLists File
# This is the version that came packaged with my version of CLion:
cmake_minimum_required(VERSION 3.7)
# I'm giving the project an arbitrary name for demonstration purposes,
# you can name it whatever you want:
project(example)
# Create a src directory at the root level of your project and add a
# file with whatever name you want (I used the project name for
# simplicity):
@mikerourke
mikerourke / wstorm.sh
Created March 2, 2017 17:07
Open WebStorm files through the command line using Git Bash on Windows.
#!/bin/bash
#
# Opens WebStorm from the command line using Git Bash for Windows. If you're
# working within the integrated terminal in WebStorm, this will open the file
# passed in using just the relative path. If the file specified doesn't exist,
# it creates it and opens it. Just copy wstorm() into wherever you keep your
# Bash aliases and make sure you change your Terminal path to Git Bash (see
# Notes section).
#
# ------
@mikerourke
mikerourke / install-yarn.md
Last active June 3, 2022 12:41
Upgrades/Installation in Cloud9

Installing Yarn in Cloud9

You can't just follow the directions on the site, you have to do some mojo first.

Step 1. Run update.

sudo apt-get update

Step 2. Install apt-transport-https.