Skip to content

Instantly share code, notes, and snippets.

View BenJam's full-sized avatar
πŸ’­
Will never update this again.

Benjamin Nickolls BenJam

πŸ’­
Will never update this again.
  • Shropshire, UK
View GitHub Profile
@BenJam
BenJam / Queue.js
Created May 23, 2011 13:42
Is this a clever or crap pattern for queue processing?
Queue = function(){
var timer = 1000;
var run = true;
var theQueue = [1,2,3,4,5];
var doSomething = function(thing){
//do something with the thing
};
var process = function(){
if(theQueue.length > 0){
doSomething(theQueue.shift());
@BenJam
BenJam / freckle.yml
Created June 6, 2012 20:02
freckle.yml config example
freckle:
subdomain: [subdomain]
authtoken: [api key]
user: [username]
@BenJam
BenJam / pages-with-template.php
Created July 2, 2012 16:18
A wordpress query to return all pages with the template $template
<?php
// Get all pages that use a particular template.
// This is used in footer-about.php to generate the navigation sections.
function pages_with_template($templates) {
$templates["compare"] = "IN";
return new WP_Query(
array(
'post_type' => 'page',
'meta_query' => array(
array(
Warning: Your Homebrew is outdated
You haven't updated for at least 24 hours, this is a long time in brewland!
@BenJam
BenJam / load-templates.js
Last active December 10, 2015 22:38
A util function to load external templates into a backbone project.
tpl = {
// Hash of preloaded templates for the app
templates:{},
// Recursively pre-load all the templates for the app.
// This implementation should be changed in a production environment. All the template files should be
// concatenated in a single file.
loadTemplates:function (names, callback) {
### Keybase proof
I hereby claim:
* I am benjam on github.
* I am benjam (https://keybase.io/benjam) on keybase.
* I have a public key ASAjgUGSlDDN0hh4f_d-MenDKWJ_Xo61YaGlmLGeY5TTwAo
To claim this, I am signing this object:
Maven/junit:junit
Maven/commons-collections:commons-collections
NPM/grunt
NPM/grunt-cli
Rubygems/rubocop
Rubygems/rake
Rubygems/selenium-webdriver
Rubygems/mime-types
NPM/grunt-contrib-jshint
Rubygems/faker

Libraries.io's Curent Metrics

Entity Name Type Description (if not obvious)
Project name String -
Project description String -
Project homepage URl -
Project keywords Array of String -
Project language String -
Project platform array of string List of distribution sources for this project e.g. npm, rubygems etc

What is this?

A scratchpad for a classifer of software libraries focussing on a number of areas that will guide users to make more informed decisions about whether to include a library within their own project.

See librariesio/libraries.io#1486 for more information.

Themes/Questions

There are a number of key themes here that we need to look at. Within each I have posed a number of questions that might be of interest to a developer or maintainer.

Code

  • What scale is this project? - Looking at things like novel LoC, #dependencies and LoC in dependencies perhaps.
β”œβ”€β”¬ [email protected]
β”‚ β”œβ”€β”¬ [email protected]
β”‚ β”‚ β”œβ”€β”€ [email protected]
β”‚ β”‚ β”œβ”€β”€ [email protected]
β”‚ β”‚ └─┬ [email protected]
β”‚ β”‚ β”œβ”€β”€ [email protected]
β”‚ β”‚ β”œβ”€β”¬ [email protected]
β”‚ β”‚ β”‚ └── [email protected]
β”‚ β”‚ β”œβ”€β”¬ [email protected]
β”‚ β”‚ β”‚ └─┬ [email protected]