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
// ==UserScript== | |
// @name Delicious Search Results on Google | |
// @namespace gaillard | |
// @description Shows results from Delicious on Google search pages | |
// @include http://www.google.*/search?*q=* | |
// @include http://www.google.*/* | |
// @date 2009-03-07 | |
// @version 0.1 | |
// @GM_version 0.8.20080609.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
# Takes: a callback function and a fallback function | |
# Returns: a callback function. | |
# Also: sets up a timeout, so that if the callback function is not called, the fallback function will be run | |
callbackWithFallback = (callback, fallback, waitSeconds) -> | |
waitSeconds = waitSeconds || 15 | |
callbackHappened = false | |
robustCallback = () -> |
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
class A | |
constructor: (@url, @data) -> | |
that = this | |
$.get @url, (data) => | |
that.data = data | |
a = new A "/my-url/" | |
console.log a |
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
diff --git a/lib/model.js b/lib/model.js | |
index 53a21e1..ba76805 100644 | |
--- a/lib/model.js | |
+++ b/lib/model.js | |
@@ -1944,6 +1944,13 @@ function populate (model, docs, options, cb) { | |
return cb(); | |
} | |
+ | |
+ // We may be asked to resolve path "comments._creator" but we are given the comments, so we only need to look into doc["_creator"], so let's drop the first part of the path. TOOD: Or should this be all but the last part? |
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
// Example usage: | |
// deepPopulate(blogPost, "comments comments._creator comments._creator.blogposts", {sort:{title:-1}}, callback); | |
// Note that the options get passed at *every* level! | |
// Also note that you must populate the shallower documents before the deeper ones. | |
function deepPopulate(doc, pathListString, options, callback) { | |
var listOfPathsToPopulate = pathListString.split(" "); | |
function doNext() { | |
if (listOfPathsToPopulate.length == 0) { | |
// Now all the things underneath the original doc should be populated. Thanks mongoose! | |
callback(null,doc); |
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
/* | |
* Do not remove the @namespace line -- it's required for correct functioning | |
*/ | |
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */ | |
/* Joey's styles for TreeStyleTabs */ | |
/* This one is probably not needed. */ | |
.treestyletab-tabbar-toolbar { | |
opacity: 1.0 !important; | |
} |
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
/* | |
* Do not remove the @namespace line -- it's required for correct functioning | |
*/ | |
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */ | |
/* This surrounds the location bar and the bookmarks toolbar */ | |
#navigator-toolbox { | |
/* border: 1px solid black !important; */ | |
} | |
/* Bookmarks Bar */ |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<svg | |
xmlns:dc="http://purl.org/dc/elements/1.1/" | |
xmlns:cc="http://creativecommons.org/ns#" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:svg="http://www.w3.org/2000/svg" | |
xmlns="http://www.w3.org/2000/svg" | |
xmlns:xlink="http://www.w3.org/1999/xlink" | |
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | |
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
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
# Derivative Values | |
Often when programming we want access to values which are actually the result | |
of calculations on other values. | |
(In some fields, such values are called "invariants".) | |
There are more complex examples, but let's start with a simple one. | |
We have a rectangle, defined by its `top`, `left`, `width` and `height`. |
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
// It may be inefficient, and a little fragile (e.g. if Node changes its stacktrace | |
// formatting), but it can be a nice tool for developers when it works. | |
// ### sunlogger.js | |
var Logger = require('devnull'); | |
var logger = new Logger({namespacing : 0}); | |
var fs = require("fs"); |
OlderNewer