This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
title: Clock | |
DomImage(dom/image),DomQuerySelector(dom/querySelector),DomSetHtml(dom/setHtml),CanvasGetContext(canvas/getContext),CanvasDrawImage(canvas/drawImage),DomQuerySelector2(dom/querySelector),MathDegreesToRadians(math/degreesToRadians),DateCreate(date/create),DateGetSeconds(date/getSeconds),CanvasBeginPath(canvas/beginPath),CanvasMoveTo(canvas/moveTo),CanvasLineTo(canvas/lineTo),CanvasLineTo2(canvas/lineTo),CanvasLineTo3(canvas/lineTo),CanvasLineTo4(canvas/lineTo),CanvasStroke(canvas/stroke),MathMultiply(math/multiply),CanvasRotate(canvas/rotate),CanvasSetAttributes(canvas/setAttributes),CanvasFill(canvas/fill),CanvasTranslate(canvas/translate),UtilWait(util/wait),ConsoleLog(console/log),CanvasStrokeText(canvas/strokeText),CanvasSave(canvas/save),ConsoleLog2(console/log),DomAddMouseEvent(dom/addMouseEvent),DomAlert(dom/alert),DateCreate2(date/create),CanvasRestore(canvas/restore),CanvasSetAttributes2(canvas/setAttributes),SoundAlert(sound/alert) | |
"http://www.dhtmlgoodies.com/tutorials/canvas-clock/i |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
// to capture ALL events use: | |
Ext.util.Observable.prototype.fireEvent = Ext.Function.createInterceptor(Ext.util.Observable.prototype.fireEvent, function(evt) { | |
var a=arguments; | |
console.log(this,' fired event ',evt,' with args ',Array.prototype.slice.call(a,1,a.length)); | |
return true; | |
}); | |
// to capture events for a particular component: | |
Ext.util.Observable.capture( | |
Ext.getCmp('my-comp'), |
For example, suppose I wanted to download the package foo
at the version ~0.2.3
. My package client would go to the central ref server and query the tags of foo
. It would then see that foo
has versions 0.2.3
, 0.2.4
, and 0.3.0
. It would decide that 0.2.4
is the desired version based on the original range query. Along with the refs the central server also told it the hashes of the root tree node for these package versions. It now knows which hash contains the desired package.
Now to get the package, we need to query the distributed network for t
(function(){ | |
"use strict"; | |
Array.prototype.clean = function() { | |
for (var i = 0; i < this.length; i++) { | |
if (this[i] == null) { | |
this.splice(i, 1); | |
i--; | |
} | |
} |
Update: my blog post The lie of the API details the issues with current APIs.
Background: I'm a researcher in semantic hypermedia, at the moment comparing different APIs for accessing metadata for human and machine consumption.
Story: I am browsing a cultural website and want to retrieve the metadata of the object I'm looking at in a machine-readable format. The steps below are the actual steps that I've undertaken on different sites.
I'm looking at the object http://collection.cooperhewitt.org/objects/35460799/.
// d8 --expose-gc --allow-natives-syntax --track-retaining-path weak-value-retaining-path.js | |
class SomeKey { | |
} | |
class Metadata { | |
constructor() { | |
this.large = new LargeObject(); | |
} | |
} |
var spawn = require('child_process').spawn; | |
var pass = require('stream').PassThrough; | |
var a = spawn('echo', ['hi user']); | |
var b = new pass; | |
var c = new pass; | |
a.stdout.pipe(b); | |
a.stdout.pipe(c); |
#!/usr/bin/env bash | |
set -x | |
shopt -s extglob dotglob | |
cd "$HOME" | |
rm -rf "$HOME/TEMP_DIR" | |
mkdir "$HOME/TEMP_DIR" | |
cd "$HOME/TEMP_DIR" | |
git init |
import 'package:flutter/material.dart'; | |
void main() => runApp(MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: HomeScreen(), | |
)); | |
class HomeScreen extends StatefulWidget { | |
@override | |
_HomeScreenState createState() => _HomeScreenState(); |