Skip to content

Instantly share code, notes, and snippets.

View BigBlueHat's full-sized avatar
🎩
building Web things

BigBlueHat BigBlueHat

🎩
building Web things
View GitHub Profile
@BigBlueHat
BigBlueHat / description
Created December 8, 2011 14:24
Description of a Project JSON format - aka DOAP.json
Description of a Project (DOAP) is an RDF format created by Edd Dumbill:
http://trac.usefulinc.com/doap/
This JSON version goes a bit farther than the RDF format by including historic release tracking and supporting download links for various platforms and architectures.
Further work could be done to bring this JSON format closer to the RDF format and provide conversions between the two (or to an updated RDF format), but it's not on my current roadmap. Feel free to fork and iterate as you'd like--if you do, I'd love to know! :)
"programming-language" tag in DOAP is now "programming-languages"
"release" tag in DOAP is "releases"
"releases" now contains an object with "latest" and (optionally) "previous" children.
@BigBlueHat
BigBlueHat / couchdb.doap
Created April 11, 2012 15:14
Apache CouchDB DOAP file
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl"?>
<rdf:RDF xml:lang="en"
xmlns="http://usefulinc.com/ns/doap#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:asfext="http://projects.apache.org/ns/asfext#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@BigBlueHat
BigBlueHat / webhook
Created May 18, 2012 19:13
WebHook _update endpoint for CouchDB
{
"_id": "_design/webhook",
"_rev": "4-4a793a444b5e524a7b1df4259b892366",
"updates": {
"receive": "function(doc, req) { if (req._id == null && req.form.payload) { newdoc = JSON.parse(req.form.payload); newdoc._id = req.uuid; newdoc['.'] = {\"webook\": {\"created\": Date()}}; return [newdoc, 'woot!']; } else { return [null, 'fale']; } }"
}
}
@BigBlueHat
BigBlueHat / pre-commit
Created July 6, 2012 14:07
Super simple git pre-commit hook for pep8 & pyflakes checking
#!/bin/sh
FILES=$(git diff --cached --name-status | awk '$1 $2 { print $2}' | grep -e \.py$)
if [ -n "$FILES" ]; then
pep8 -r $FILES
pyflakes $FILES
fi
@BigBlueHat
BigBlueHat / README
Created August 20, 2012 19:25
sql2couch beer data import scripts
This code was used to import the openbeerdatabase.com data into .json docs onto the filesystem.
This fork of sql2couchdb was used:
https://github.com/BigBlueHat/sql2couchdb/tree/bulk_insert_batches
Plus a few .json sql2couchdb mappings in this repo.
@BigBlueHat
BigBlueHat / .vimrc
Last active December 18, 2015 12:19
My .vimrc...as of the moment
set nocompatible
filetype off
" Use Vundle to manage plugins and such.
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Let Vundle manage Vundle
Bundle 'gmarik/vundle'
@BigBlueHat
BigBlueHat / eloquent.php
Last active December 19, 2015 01:39 — forked from ziadoz/eloquent.php
revised to get this to work with Eloquent 4.0.3
<?php
class Post
{
protected $table = 'posts';
/**
* You can define your own custom boot method.
*
* @return void
**/
@BigBlueHat
BigBlueHat / jsoon.php
Last active December 20, 2015 06:49
JSOON - JSON Sans-Optional Object Notation
<?php
/**
The MIT License (MIT)
Copyright (c) 2013 Benjamin Young (aka BigBlueHat)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
@BigBlueHat
BigBlueHat / gist:11144543
Last active August 29, 2015 14:00
aspen.io test failures on Windows
Ignoring indexes: https://pypi.python.org/simple/
Requirement already satisfied (use --upgrade to upgrade): coverage>=3.7.1 in c:\users\benjamin\documents\github\aspen-python\env\lib\site-packages
Cleaning up...
env\Scripts\pip.exe install --no-index --find-links=./vendor/test coverage>=3.7.1
Ignoring indexes: https://pypi.python.org/simple/
Requirement already satisfied (use --upgrade to upgrade): cov-core>=1.7 in c:\users\benjamin\documents\github\aspen-python\env\lib\site-packages
Cleaning up...
env\Scripts\pip.exe install --no-index --find-links=./vendor/test cov-core>=1.7
Ignoring indexes: https://pypi.python.org/simple/
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.20 in c:\users\benjamin\documents\github\aspen-python\env\lib\site-packages
@BigBlueHat
BigBlueHat / data-and-template.js
Last active August 29, 2015 14:01
Mustache "tree" navigation for year + months
data = {"years":{"rows": [{"value": 3047, "key": [2014], "year": 2014}, {"months": {"rows": [{"value": 554, "key": [2013, 12], "month": 12}, {"value": 467, "key": [2013, 11], "month": 11}, {"value": 503, "key": [2013, 10], "month": 10}, {"value": 241, "key": [2013, 9], "month": 9}, {"value": 428, "key": [2013, 8], "month": 8}, {"value": 442, "key": [2013, 7], "month": 7}, {"value": 434, "key": [2013, 6], "month": 6}, {"value": 730, "key": [2013, 5], "month": 5}, {"value": 456, "key": [2013, 4], "month": 4}, {"value": 1118, "key": [2013, 3], "month": 3}, {"value": 387, "key": [2013, 2], "month": 2}, {"value": 489, "key": [2013, 1], "month": 1}]}, "value": 6249, "key": [2013], "year": 2013}, {"value": 4407, "key": [2012], "year": 2012}]}};
template = '{{#years}}<ul> {{#rows}} <li><a href="/{{year}}/?q={{#qs}}{{q}}{{/qs}}">{{year}}</a> ({{value}}) {{^months}} - no months {{/months}}{{> months}} </li> {{/rows}}</ul>{{/years}}';
months = '{{#months}}<ul> {{#rows}} <li><a href="/{{year}}/{{month}}/?q={{#