Scaleable Clickable Sublime Text Logo
A Pen by Hugo Darby-Brown on CodePen.
Scaleable Clickable Sublime Text Logo
A Pen by Hugo Darby-Brown on CodePen.
function getFnName(fn) { | |
fn = Object(fn) | |
var F = typeof fn == 'function' | |
var N = fn.name | |
var S = F && ((N && ['', N]) || fn.toString().match(/function ([^\(]+)/)) | |
return (!F && 'not a function') || (S && S[1] || 'anonymous'); | |
} | |
console.log(getFnName(String)); // 'String' | |
console.log(getFnName(function test(){})); // 'test' |
// ==UserScript== | |
// @name View on flifkriver | |
// @namespace http://lamehacks.net | |
// @description Adds links to flickriver on flickr group, user, tag and search pages | |
// @include http://*.flickr.com/* | |
// @match http://*.flickr.com/* | |
// ==/UserScript== | |
var groupRegex = new RegExp(".*?flickr.com/groups/([^\/]*)"); | |
var matched = groupRegex.exec(window.location); |