Skip to content

Instantly share code, notes, and snippets.

View briantjacobs's full-sized avatar

Brian Jacobs briantjacobs

View GitHub Profile
@jrleeman
jrleeman / rgb_animation.py
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 cartopy.crs as ccrs
import numpy as np
from metpy.plots import add_logo
@maximilian-lindsey
maximilian-lindsey / express_in_electron.md
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
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 <http://epic.gsfc.nasa.gov/> image and sets it as your desktop picture. Prerequisites: requires installing Homebrew <http://brew.sh/> 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
download_directory="$HOME/Desktop/_dl/epic-earth";
apiurl="http://epic.gsfc.nasa.gov/api/images.php";
curl -s "$apiurl" | jshon -a -e image -u | while read image; do
destfile="$download_directory/$image.jpg";
mkdir -p "$download_directory";
if [[ -n "$image" && ! -f "$destfile" ]]; then
echo "New 🌍 ! $image.jpg";
curl -so "$destfile" "http://epic.gsfc.nasa.gov/epic-archive/jpg/$image.jpg";
ln -sf "$destfile" "$download_directory/latest.jpg";
@paulirish
paulirish / what-forces-layout.md
Last active April 24, 2024 01:42
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
swehrwein / himawari_bg.py
Last active July 7, 2020 17:32
Script to change mac os desktop background to a minutes-old image of Earth.
#!/usr/local/bin/python
# 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 himawari_bg.py)
# setup a cron job to run this script every 10 minutes
@ashaw
ashaw / landsat-db.rb
Last active September 19, 2015 02:24
# get the CSV from http://landsat.usgs.gov/metadata_service/bulk_metadata_files/LANDSAT_8.csv
require 'csv'
FILE = File.expand_path("..", __FILE__) + "/initial/LANDSAT_8.csv"
SCHEMA = <<-SQL
DROP TABLE "landsat8";
CREATE TABLE "landsat8" (
"sceneid" varchar(21) not null,
sensor varchar(8) not null,
@gka
gka / make-tile-urls.py
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
dalekunce / mac_gis_setup.md
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"
}
end
end
@addyosmani
addyosmani / package.json
Last active January 18, 2024 21:31
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",