Skip to content

Instantly share code, notes, and snippets.

View briantjacobs's full-sized avatar

Brian Jacobs briantjacobs

View GitHub Profile
jrleeman /
Created September 11, 2017 17:10
GOES-16 RGB Animation
from datetime import datetime
from scipy import interpolate
from siphon.catalog import TDSCatalog
from netCDF4 import Dataset
import matplotlib.pyplot as plt
from matplotlib import patheffects
import cartopy.feature as cfeat
import as ccrs
import numpy as np
from metpy.plots import add_logo
maximilian-lindsey /
Last active March 29, 2024 22:46
How to run Express inside an Electron app

How to run Express inside an Electron app

You can run your Express app very easily inside your Electron app.

All you need to do is to:

  • place all the files of your Express app inside a new app folder in your_electron_app\resources\app
  • reconfigure the app.js file
  • refactor some relative pathes in your Express app
quinncomendant / dscovr-epic-desktop
Last active September 13, 2018 22:14
This is an OS X command-line script that downloads the latest DSCOVR:EPIC <> image and sets it as your desktop picture. Prerequisites: requires installing Homebrew <> and then the jshon tool (`brew install jshon`). Then you can run the command manually, or add it to your crontab.
#!/usr/bin/env bash
curl -s "$apiurl" | jshon -a -e image -u | while read image; do
mkdir -p "$download_directory";
if [[ -n "$image" && ! -f "$destfile" ]]; then
echo "New 🌍 ! $image.jpg";
curl -so "$destfile" "$image.jpg";
ln -sf "$destfile" "$download_directory/latest.jpg";
paulirish /
Last active May 24, 2024 19:16
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
swehrwein /
Last active July 7, 2020 17:32
Script to change mac os desktop background to a minutes-old image of Earth.
# Tested on Mac OS Yosemite circa July 2015, when NNVL had just started
# making Himawari images available. Hopefully they keep it up!
# Installation:
# pip install appscript
# change the image storage path below
# make executable (chmod +x
# setup a cron job to run this script every 10 minutes
ashaw / landsat-db.rb
Last active September 19, 2015 02:24
# get the CSV from
require 'csv'
FILE = File.expand_path("..", __FILE__) + "/initial/LANDSAT_8.csv"
DROP TABLE "landsat8";
CREATE TABLE "landsat8" (
"sceneid" varchar(21) not null,
sensor varchar(8) not null,
gka /
Last active August 26, 2022 06:27
python script to generate a list of projected tiles
# you might want to run this first:
# pip install pyproj mercantile
from pyproj import Proj
import mercantile
mercator = Proj('+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +over +no_defs')
albers = Proj('+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=sphere +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +nadgrids=@null')
dalekunce /
Last active July 29, 2023 22:18
Yosemite GIS Machine Setup

Mac OS X GIS Setup

OS X Preferences

# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
class TilesController < ApplicationController
around_filter :up_s3
def tile_response(map)
respond_to do |format|
format.png {
send_data map.to_png, :content_type => Mime::Type.lookup_by_extension("png"), :disposition => "inline"
addyosmani / package.json
Last active May 21, 2024 19:56
npm run-scripts boilerplate
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",