Move your mouse around
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f x y = [x] ++ y | |
--<function> : a -> [a] -> [a] | |
g y = (\x -> f x y) | |
--<function> : [a] -> a -> [a] | |
items = [1,2,3] | |
--[1,2,3] : [number] | |
g items | |
--<function> : number -> [number] | |
g items 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main : Element | |
main = cube | |
cube = flow down [ row1, row2, row3, row4 ] | |
row1 = flow right [ | |
color grey (container 30 30 middle (plainText "A")) | |
, color grey (container 30 30 middle (plainText "")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main : Element | |
main = cube | |
cube = flow down tiles | |
f x = color grey (container 30 30 middle (plainText x)) | |
g x = flow right (map f x) | |
tiles = map g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f1 z = z + 1 | |
f2 z = z + 2 | |
f3 z = z + 3 | |
f4 z = z + 4 | |
g f = f 1 | |
-- g f1 = 2 | |
[f1 1, f2 1, f3 1, f4 1] | |
-- [2,3,4,5] : [number] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main : Element | |
main = collage 400 400 | |
(map (move (50, 0) )( | |
(motif x red ) ++ (motif (t x) blue ) ++ (motif (t (t x)) green ) ++ | |
(motif (t (t (t x))) orange ) )) | |
-- build motif from path and color | |
motif : [(number, number)] -> Color -> [Form] | |
motif z color = [ traced (solid color) (path z) , move ( last z) (filled color (circle 3.0))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main : Element | |
main = flow down | |
[ leftAligned (toText "A") | |
, leftAligned (toText "B") | |
, leftAligned (toText "C") | |
] |
screencasts on ubuntu have been a pain in the neck. this gist is to document some of the difficulties so I don't have to repeat them.
the idea started when trying to convert a d3.js graphic into animatic gif and found this github program. The term is screen capture
Here is what I came up with
- record the avi with ffmpeg
- converge the ffmpeg to gif with imagemagic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from skimage import io | |
import matplotlib.pyplot as plt | |
import numpy as np | |
plt.rcParams['figure.figsize'] = 6,6 | |
im = io.imread("filename.jpg") | |
#crop | |
piece = im[1250:2250, 1250:2250,:] |