Skip to content

Instantly share code, notes, and snippets.

View brianbancroft's full-sized avatar
🌲

Brian Bancroft brianbancroft

🌲
View GitHub Profile
@brianbancroft
brianbancroft / JEST_VITE_APP.md
Created February 9, 2022 19:37
Integrate Jest & React Testing Library in a React Vite Project.

Integrate Jest & React Testing Library in a React Vite Project

  1. Install Dependencies
yarn add --dev jest babel-jest @babel/preset-env @babel/core @babel/plugin-syntax-jsx @babel/preset-react @testing-library/dom @testing-library/jest-dom @testing-library/react @testing-library/user-event babel-preset-react-app identity-obj-proxy jest-circus jest-scss-transform jest-watch-typeahead
  1. Set Jest & babel configs in package.json
"jest": {
    "roots": [
@brianbancroft
brianbancroft / custom-task.js
Created April 16, 2019 12:34 — forked from CITguy/custom-task.js
Basic pattern for creating a custom Transform stream for use with gulp tasks.
var gulp = require('gulp');
var myTransform = require('./myTransform');
gulp.task('foobar', function (){
return gulp.src("foobar.js")
.pipe(myTransform())
.pipe(gulp.dest('.'));
});
@brianbancroft
brianbancroft / gist:2cb17b975a0b3240de05e5b8a5960096
Created June 7, 2018 02:49 — forked from philipn/gist:1148693
GeoTIFFs -> One Big GeoTIFF
"""
Likely not useful to anyone else, but just putting it out there.
This script will take a directory of GeoTIFFs and merge them together without issues.
This script simply decompresses the files, runs nearblack to remove pseudo-black borders caused by compression, and then uses gdalwarp to stitch the files together.
The script is designed to use the minimal amount of disk space possible -- it cleans up each file after decompression and continually merges with a master image.
"""
import os
@brianbancroft
brianbancroft / vscode-styles.css
Created July 24, 2017 13:24
vscode-styles for operator mono, fira code ligatures, and oceanic next italic
.type.storage,.type.storage.declaration, .storage.class.modifier {
font-family: 'Operator Mono Book';
}
.type.storage.arrow.function {
font-family: 'Fira Code'
}
.token.keyword.operator {
font-family: 'Fira Code'
@brianbancroft
brianbancroft / vscode-styles.css
Created July 24, 2017 13:23 — forked from td0/VSCode-custom.css
vscode-styles for operator mono, fira code ligatures, and oceanic next italic
.type.storage,.type.storage.declaration, .storage.class.modifier {
font-family: 'Operator Mono';
}
.type.storage.arrow.function {
font-family: 'Fira Code'
}
.token.keyword.operator {
font-family: 'Fira Code'
@brianbancroft
brianbancroft / .block
Last active November 17, 2016 20:39 — forked from mbostock/.block
D3 JS Object Line Chart with ToolTips
license: gpl-3.0
@brianbancroft
brianbancroft / for_brian.py
Last active December 31, 2015 21:09 — forked from mrmch/for_brian.py
I've played around with the file, learnt a few new things and still am drawing a bit of a blank.
fname = 'C:\\Temp\\SIC_Core.txt'
ofname = 'C:\\Temp\\SIC_Fixed.txt'
with open(fname, 'r') as ifile:
input = ifile.readlines(-1)
with open(ofname, 'w') as ofile:
i = 0
while i < len(input):