In Javascript this
is bound in unexpected ways. Functions, in particular, create a new 'this' and so when you want to keep a reference to an "outer" object you sometimes see the pattern:
var self = this;
as in:
var self = this;
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \ | |
--header 'Accept: application/vnd.github.v3.raw' \ | |
--remote-name \ | |
--location https://api.github.com/repos/owner/repo/contents/path | |
# Example... | |
TOKEN="INSERTACCESSTOKENHERE" | |
OWNER="BBC-News" | |
REPO="responsive-news" |
javascript: | |
(function(){ | |
var path = 'https://secure.diigo.com/api/v2/bookmarks'; | |
var params = { | |
'url': document.URL, | |
'title': document.title, | |
'tags': 'oneclick', | |
'shared': 'no' | |
}; |
#!/usr/bin/env bash | |
# script: watch | |
# author: Mike Smullin <mike@smullindesign.com> | |
# license: GPLv3 | |
# description: | |
# watches the given path for changes | |
# and executes a given command when changes occur | |
# usage: | |
# watch <path> <cmd...> | |
# |