Skip to content

Instantly share code, notes, and snippets.

@jczaplew
jczaplew / README.md
Last active September 14, 2017 23:21
Responsive TopoJSON Sizing with d3.js

States will adjust in size relative to the width of the container div, which allows SVG elements to be appropriately sized regardless of device size or screen resolution, making it a good way to integrate D3 and Bootstrap.

Click "Open in a new window", change the size of your browser window, and the states will scale with it. *Will not work in the standard bl.ocks.org view

Please let me know if there is a better/native way to do this!

@geotheory
geotheory / 3d_mapping
Last active July 1, 2021 18:01
Plotting 3D maps using OpenStreetMap and RGL.
# Plotting 3D maps using OpenStreetMap and RGL. For info see:
# http://geotheory.co.uk/blog/2013/04/26/plotting-3d-maps-with-rgl/
map3d <- function(map, ...){
if(length(map$tiles)!=1){stop("multiple tiles not implemented") }
nx = map$tiles[[1]]$xres
ny = map$tiles[[1]]$yres
xmin = map$tiles[[1]]$bbox$p1[1]
xmax = map$tiles[[1]]$bbox$p2[1]
ymin = map$tiles[[1]]$bbox$p1[2]

Functions, how do they work?

A good friend asked me how functions work under the covers, so I wrote up this quick explanation. Corners are cut for brevity, but I hope it will convey the general idea.

The three assembly language programs below implement the following (super simple) recursive function:

@jfreels
jfreels / README.md
Last active May 27, 2021 09:39
d3js: Create an HTML select box using d3.js and create a paragraph referencing the selection.

d3js: Create an HTML select box using d3.js and create a paragraph referencing the selection.

@hugolpz
hugolpz / Wikidata-API-via-JS.markdown
Last active March 21, 2024 14:49
Wikidata API via JS
@maximilian-lindsey
maximilian-lindsey / express_in_electron.md
Last active August 7, 2025 14:15
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
@audy
audy / Dockerfile
Last active November 6, 2017 18:40
PacBio SMRT Analysis Server in Docker
FROM centos
# following http://www.pacb.com/wp-content/uploads/2015/09/SMRT-Analysis-Software-Installation-v2.3.0.pdf
MAINTAINER [email protected]
ENV SMRT_ROOT=/opt/smrtanalysis/
ENV SMRT_USER=smrtanalysis
ENV SMRT_GROUP=smrtanalysis
@hrbrmstr
hrbrmstr / orig.png
Last active July 16, 2023 06:43
Supreme Annotations - moar splainin here: http://rud.is/b/2016/03/16/supreme-annotations/ - NOTE: this requires the github version of ggplot2
orig.png
@stefanfoulis
stefanfoulis / docker_for_mac_disk_default_size.md
Last active June 29, 2023 12:02
How to resize Docker for Mac Disk image and set the default size for new images

Set the default size for new Docker for Mac disk images

UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).

If you are getting the error: No space left on device

Configuring the qcow2 size cap is possible in the current versions:

# my disk is currently 64GiB
@mprokopov
mprokopov / core.cljs
Last active November 1, 2019 21:05
rum + material-ui
(ns speakup.core
(:require [rum.core :as rum]
[cljs-react-material-ui.core :refer [get-mui-theme color]]
[cljs-react-material-ui.icons :as ic]
[cljs-react-material-ui.rum :as ui]
[cljs-react-material-ui.chip-input.rum :refer [chip-input]]))
(enable-console-print!)
;; (println "This text is printed from src/speakup/core.cljs. Go ahead and edit it and see reloading in action.")