Skip to content

Instantly share code, notes, and snippets.

  • YEAR (2001, 1965, 1936) \b(19|20)\d{2}\b
  • Arconyms (DDF, DACF, AF) \w*\([A-Z]\w*[A-Z]\)\w*
  • trailing spaces [ \f\t\v]\n
@dcfvg
dcfvg / contact-impro.sh
Created February 21, 2019 11:53
PDF to flatten image
# raw pile
for i in `ls *.pdf`; do convert -density 96 "$i" -flatten +antialias jpg/"$i"-%04d.jpg; done
# magickwand on white background
for i in `ls *.pdf`; do convert -density 96 "$i" -fuzz 30% -transparent white -flatten +antialias jpg-whiteremove/"$i"-%04d.jpg; done
# page by pages
for i in `ls *.pdf`; do convert -density 220 "$i" -resize 50% jpg-pages/"$i"-%04d.jpg; done
@dcfvg
dcfvg / syncAudio.html
Created September 1, 2017 10:54
sync audio and events html5
<audio id="audiofile" src="//pathtoyouraudiofile.mp3" controls></audio>
<div id="subtitles"></div>
<script>
( function(win, doc) {
var audioPlayer = doc.getElementById("audiofile");
var subtitles = doc.getElementById("subtitles");
var syncData = [
{ "end": "0.225","start": "0.125","text": "There" },
{"end": "0.485","start": "0.225","text": "were" },
@dcfvg
dcfvg / index.js
Last active August 9, 2016 10:06
curricugraph
import Graph from 'graphology';
import sentences from 'talisman/tokenizers/sentences';
import words from 'talisman/tokenizers/words';
import flattenDeep from 'lodash/flattenDeep';
import uniq from 'lodash/uniq';
const txt = 'A project with Andy and Jean-Michel at the Factory. In 1920 Pablo meets Salvador and Claude . An exhibition features Andy and Pablo in Beaubourg.'
const txtSentences = sentences(txt);
@dcfvg
dcfvg / immerslide.js
Last active January 10, 2017 11:48
A small auto slide show function for mit immersion (https://immersion.media.mit.edu)
var emails = VMail.App.db.emails;
var oldest = emails[0].timestamp;
var newest = emails[emails.length - 1].timestamp;
console.log(oldest,newest);
var increment = 60*60*24*6;
var duration = 60*60*24*30*12;
var start = oldest;
@dcfvg
dcfvg / gist:3238655
Created August 2, 2012 16:55
glib/config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by glib configure 2.32.3, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure --disable-option-checking --prefix=/usr/local/Cellar/pkg-config/0.27 --disable-debug --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig --with-internal-glib CC=/usr/bin/clang CFLAGS=-Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.8 LDFLAGS=-L/usr/local/Cellar/gettext/0.18.1.1/lib -L/usr/local/lib CPPFLAGS=-I/usr/local/Cellar/gettext/0.18.1.1/include -isystem /usr/local/include --cache-file=/dev/null --srcdir=.
## --------- ##
## Platform. ##
@dcfvg
dcfvg / gist:3230149
Created August 1, 2012 19:56
brew install -vd pkgconfig / config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by pkg-config configure 0.27, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.27 --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig --with-internal-glib
## --------- ##
## Platform. ##
@dcfvg
dcfvg / gist:3230141
Created August 1, 2012 19:54
brew install -vd pkgconfig
$ brew install -vd pkgconfig
==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.27.tar.gz
Already downloaded: /Library/Caches/Homebrew/pkg-config-0.27.tar.gz
/usr/bin/tar xf /Library/Caches/Homebrew/pkg-config-0.27.tar.gz
==> ./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.27 --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig --with-internal-glib
./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.27 --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig --with-internal-glib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
@dcfvg
dcfvg / gist:3199312
Created July 29, 2012 14:43
brew doctor
dyld: Library not loaded: /usr/lib/libltdl.7.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
dyld: Library not loaded: /usr/lib/libltdl.7.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
brew install pkg-config
@dcfvg
dcfvg / gist:3199271
Created July 29, 2012 14:39
pkg-config configure 0.27
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by pkg-config configure 0.27, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.27 --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig --with-internal-glib
## --------- ##
## Platform. ##