Live JS Demo by Lopez Hugo
A Pen by Lopez Hugo on CodePen.
Live JS Demo by Lopez Hugo
A Pen by Lopez Hugo on CodePen.
Packer is a tool from Hashicorp that allows you to create machine images in a variety of formats from a single spec file. This can be a very powerful thing when you want to automate the deployment of applications to a variety (or even just more than one, really) platforms.
In our case, we want to deploy an application to VMware and AWS, and soon to Docker. Doing that with a single spec file gives us
d3js: Create an HTML select box using d3.js and create a paragraph referencing the selection.
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:
# 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] |
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!
<!DOCTYPE> | |
<html> | |
<head> | |
<script src="http://chmille4.github.com/Scribl/js/Scribl.1.0.min.js"></script> | |
<script src="http://chmille4.github.com/Scribl/js/genbankData.js"></script> | |
<link rel="stylesheet" id="themeCSS" href="http://chmille4.github.com/Scribl/css/iThing.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script> | |
<script src="http://static.tumblr.com/fcdode8/Giymeu17u/jquery.mousewheel.min.js"></script> | |
<script src="http://static.tumblr.com/fcdode8/WVbmeu18t/jqallrangesliders-min.js"></script> |
# Truly the most ridiculous thing I could think of. | |
doInstall <- TRUE # Change to FALSE if you don't want packages installed. | |
toInstall <- c("XML", "png", "devtools", "RCurl") | |
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")} | |
lapply(toInstall, library, character.only = TRUE) | |
# Some helper functions, lineFinder and makeTable | |
source_gist("818983") | |
source_gist("818986") |
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
Join R1 and R2, or print unpaired reads of R1 or R2 | |
This script assumes there is whitespace separating the readname from the pair number: | |
> < | |
@HW-ST997:140:D0UA5ACXX:8:1101:1497:2138 1:N:0:ATCACG | |
@HW-ST997:140:D0UA5ACXX:8:1101:1497:2138 2:N:0:ATCACG |
% Copyright (c) 2010 Michael Ummels <michael@ummels.de> | |
% | |
% Permission to use, copy, modify, and/or distribute this software for any | |
% purpose with or without fee is hereby granted, provided that the above | |
% copyright notice and this permission notice appear in all copies. | |
% | |
% THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
% WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
% MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
% ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |