I hereby claim:
- I am tylerball on github.
- I am tylerball (https://keybase.io/tylerball) on keybase.
- I have a public key whose fingerprint is 10E6 8CEF 19FE 1962 021C A78C 68F4 DDE7 1842 49C3
To claim this, I am signing this object:
#!/usr/bin/python | |
# vim: set fileencoding=utf-8 | |
# inspired by: | |
# https://github.com/JKodner/upsdwn/blob/master/upsdwn.py | |
import sys | |
import subprocess | |
clip = subprocess.Popen(['pbpaste'], stdout=subprocess.PIPE) |
I hereby claim:
To claim this, I am signing this object:
require 'preamble' | |
require 'pandoc-ruby' | |
Dir.glob('*.textile').each do |file| | |
front = Preamble.load(file) | |
converter = PandocRuby.new(front.content, from: :textile, to: :markdown) | |
markdown = converter.convert | |
new_file = Preamble.new(front.metadata, markdown) | |
new_file.save(file.sub('textile', 'markdown')) | |
end |
#!/usr/bin/python | |
# vim: set fileencoding=utf-8 | |
# inspired by: | |
# https://github.com/JKodner/upsdwn/blob/master/upsdwn.py | |
import sys | |
import subprocess | |
clip = subprocess.Popen(['pbpaste'], stdout=subprocess.PIPE) |
(function() { | |
var autolink=function(text){ | |
var pattern=/(^|[\s\n]|<br\/?>)(~[\w_]+)/gi; | |
return text.replace(pattern, "$1<a href='http://tilde.club/$2'>$2</a>"); | |
}; | |
var els = document.getElementsByTagName('p') | |
for(i = 0;i < els.length; i++) { | |
els[i].innerHTML = autolink(els[i].innerHTML); | |
}; | |
})(); |
all_jpegs = Dir.glob('**/*.jpg') | |
interlaced = [] | |
all_jpegs.each do |f| | |
is_interlaced = %x(identify -verbose #{f} | grep "Interlace: None") | |
if is_interlaced.length > 0 | |
puts "Converting #{f}" | |
interlaced << f | |
%x(jpegtran -copy all -progressive -outfile #{f} #{f}) | |
end |
3d piechart using THREE.js and some lodash.
The Pie
constructor takes two arguments, the id
of the element to place it
and a data
object. The data object needs some values:
divisions
: An array of floats representing their percentage share of the
graph. The remainder will be automatically filled.colors
: An array of colours. Should be one element longer than divisions
to accommodate colouring the remainder.#!/usr/bin/python | |
# coding=utf-8 | |
import random | |
import sys | |
faces = [ | |
'(◕‿◕✿)', | |
'ヽ(‘ ∇‘ )ノ', | |
'ヾ(@⌒▽⌒@)ノ', | |
'(◡‿◡✿╰)', |
let mapleader = "," | |
map <Leader>x :restore<Space> | |
map <C-b> :buffer<Space> |
This simple line chart is constructed from a TSV file storing the closing value of AAPL stock over the last few years. The chart employs conventional margins and a number of D3 features: