Make sure ffmpeg is up-to-date:
brew update
brew upgrade ffmpeg
Convert a MOV into frames. Tweak the 2/1
if you want more or fewer frames.
import sqlite3 | |
# open connection and get a cursor | |
conn = sqlite3.connect(':memory:') | |
c = conn.cursor() | |
# create schema for a new table | |
c.execute('CREATE TABLE IF NOT EXISTS sometable (name, age INTEGER)') | |
conn.commit() |
var textWidth = (function() { | |
function charW(w, c) { | |
if (c == 'W' || c == 'M') w += 15; | |
else if (c == 'w' || c == 'm') w += 12; | |
else if (c == 'I' || c == 'i' || c == 'l' || c == 't' || c == 'f') w += 4; | |
else if (c == 'r') w += 8; | |
else if (c == c.toUpperCase()) w += 12; | |
else w += 10; | |
return w; | |
} |
Make sure ffmpeg is up-to-date:
brew update
brew upgrade ffmpeg
Convert a MOV into frames. Tweak the 2/1
if you want more or fewer frames.
If you love deploying websites using Github, but for some reason want to use your own server, this script might be exactly what you need.
github.php
somewhere on your PHP-enabled web server, and make it
accessible for the outside world. Let's say for now the script lives
on http://example.com/github.php#target Illustrator | |
// script.name = RemoveClippingMasks.jsx | |
// script.description = deletes all PageItems being used as clipping masks. | |
// script.parent = Kenneth Webb // 01/07/2013 | |
// script.elegant = true? | |
var docRef = app.activeDocument; | |
var clippingCount = 0 | |
clipScan() |
# | |
# 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') |
[{ | |
"file": "results", | |
"data": { | |
"AL": { | |
"fill": "#cc3d3d", | |
"stroke": false | |
}, | |
"AK": { | |
"fill": "#cc3d3d", | |
"stroke": false |
needs(dplyr, tidyr, readr, jsonlite) | |
trump_ratings <- read_csv('https://projects.fivethirtyeight.com/trump-approval-data/approval_topline.csv') %>% | |
filter(subgroup=='All polls') %>% | |
mutate(date=as.Date(modeldate, format='%m/%d/%Y'), | |
approve=as.numeric(approve_estimate), | |
disapprove=as.numeric(disapprove_estimate)) %>% | |
select(date, approve, disapprove, president) |