Required tools for playing around with memory:
hexdump
objdump
readelf
xxd
gcore
package main | |
type VarSum func(a ...int) interface{} | |
func curry(fn func(x, y, z int) int, args ...int) interface{} { | |
if len(args) >= 3 { | |
return fn(args[0], args[1], args[2]) | |
} | |
return VarSum(func(more ...int) interface{} { | |
args = append(args, more...) |
As soon as I saw the new YouTube Player and its new morphing play/pause button, I wanted to understand how it was made and replicate it myself.
From my analysis it looks like YouTube is using [SMIL animations][1]. I could not get those animations to work on browsers other than Chrome and it appears [that they are deprecated and will be removed][2]. I settled for the following technique:
Define the icon path
elements inside a defs
element so that they are not drawn.
Draw one icon by defining a use
element whose xlink:href
attribute points to one of the path
s defined in the previous step. Simply [changing this attribute to point to the other icon is enough to swap them out][3], but this switch is not animated. To do that,
Replace the use
with the actual path
when the page is loaded.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.