Skip to content

Instantly share code, notes, and snippets.

<!doctype><html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Odyssey.js Slides</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="https://cartodb.github.io/odyssey.js/editor/favicon.png">
<link rel="icon" type="image/png" href="https://cartodb.github.io/odyssey.js/editor/favicon.png">
@jrue
jrue / index.html
Last active August 10, 2020 23:22
<!doctype><html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Odyssey.js Slides</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="https://cartodb.github.io/odyssey.js/editor/favicon.png">
<link rel="icon" type="image/png" href="https://cartodb.github.io/odyssey.js/editor/favicon.png">
@jrue
jrue / subtitle.sh
Last active July 10, 2019 01:07
Attach captions to .mp4 container using ffmpeg
# Helpful links:
# https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/subtitle_options
# https://gist.github.com/scottopell/5764a12aa488eb68e730b627c0ae06ef
# https://otranscribe.com/
### Adding captions to mp4 movie stream for availibity in a number of programs.
# input_video (mp4 format only)
# captions.srt (captions in SRT format: https://en.wikipedia.org/wiki/SubRip )
# mov_text requred. This refers to the format specific to mp4s, it has nothing to do with naming
@jrue
jrue / multilinelabels.js
Created December 7, 2018 03:36
D3 Multiline Labels
d3.selection.prototype.wrappedText = function(width) {
this.each(function(d) {
var text = d3.select(this);
if(text.text() === ""){ return this; }
var words = text.text().split(/\s+/).reverse(),
word,
line = [],
lineNumber = 0,
lineHeight = 1.1, // ems
y = text.attr("y"),
@jrue
jrue / fresno_arrests.py
Created March 16, 2018 19:06
Fresno County Jail Blotter Scraper
#!/usr/bin/python
from bs4 import BeautifulSoup
import urllib.request as ur
import re
import json
r = ur.urlopen("https://www.fresnosheriff.org/releases/jailblotter.aspx")
soup = BeautifulSoup(r, "html5lib")
tables = soup.find_all("table")
@jrue
jrue / index.html
Created August 4, 2016 23:13
News Package Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
@jrue
jrue / decrypt.js
Last active June 3, 2022 14:34
Encrypt static HTML with Ruby and CryptoJS.
var payload = "{{ content | encrypt_data }}".split("|"); //content via Ruby
var iv = payload[0]
hmac = payload[1],
cipherText = payload[2];
//CryptoJS keeps all objects as WordArrays, so you have to coerce as strings at times.
//Only get passphrase via input or cookie, convert to sha256 hex digest
//echo -n "passphrase" | openssl dgst -sha256
@jrue
jrue / index.html
Last active August 9, 2023 14:21
HTML & CSS Wheel Of Fortune / Bingo Game
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Wheel of Fortune Bingo</title>
<!--
MIT License
@jrue
jrue / keybase.md
Last active August 29, 2015 14:03
Keybase verification

Keybase proof

I hereby claim:

  • I am jrue on github.
  • I am jrue (https://keybase.io/jrue) on keybase.
  • I have a public key whose fingerprint is A2F8 9A6A EA47 1319 7465 69E4 BEE1 A29D 00CE 40C7

To claim this, I am signing this object:

@jrue
jrue / index.html
Last active August 29, 2015 14:02
<!DOCTYPE html>
<html>
<head>
<title>Taxonomy</title>
<script type="text/javascript" src="js/prefixfree.min.js"></script>
<link href="css/radios-to-slider.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/d3.v3.min.js"></script>
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="js/jquery.radios-to-slider.min.js"></script>