Skip to content

Instantly share code, notes, and snippets.

View BillBarnhill's full-sized avatar
💭
Learning Rust

=Bill.Barnhill BillBarnhill

💭
Learning Rust
View GitHub Profile
@BillBarnhill
BillBarnhill / InventoryArchiveBasics.md
Created May 24, 2014 16:45
Saving and Loading WhiteCore Inventory Archives

= Using Inventory Archives

== Saving an inventory Archive

On one user create the outfit in a new folder underneath Clothing.

Log into your grid as your test user, the one that will create the outfit. In my case this is "Test User".

We'll start with the Donarl avatar from OSAvatars.org, and add some minor tweaks, but you can start with anything you have in your inventory. It's important to make sure you keep any notecards with attributions, and respect any permissions or copyrights. I like to add a notecard titled 'Attributions', which lists the sources for the various Creative Commons items I use.

@prefix : <urn:j:>.
@prefix gage: <urn:j:gage:>.
@prefix howe: <urn:j:howe:>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix windows: <urn:windows:> .
@BillBarnhill
BillBarnhill / hipchat_bot.js
Created April 28, 2011 18:25 — forked from powdahound/hipchat_bot.js
Basic XMPP bot example for HipChat using node.js
// Basic XMPP bot example for HipChat using node.js
// To use:
// 1. Set config variables
// 2. Run `node hipchat_bot.js`
// 3. Send a message like "!weather 94085" in the room with the bot
var request = require('request'); // github.com/mikeal/request
var sys = require('sys');
var util = require('util');
@BillBarnhill
BillBarnhill / phoenix_headers_snippet.ex
Created October 3, 2015 14:03
Snippet showing how to dump request headers into response as JSON, put in controller
def mapify({k,v}, m) do
Map.put(m, k, v)
end
def show(conn, %{"id" => id, "as" => "headers"}) do
resp_body = conn.req_headers
|> List.foldl(Map.new(), &mapify/2)
|> Poison.encode!
send_resp(conn, 200, resp_body)
end
@BillBarnhill
BillBarnhill / tag_link_list.ex
Last active October 4, 2015 18:31
My snippet for generation of tag list using PhoenixHTML
@BillBarnhill
BillBarnhill / tag_link_list.ex
Created October 4, 2015 18:40
My fixed snippet for generation of tag list using PhoenixHTML
@BillBarnhill
BillBarnhill / BarnhillErlangTip1
Created November 28, 2012 11:58
Connecting erlang nodes before apps start
To do the equivalent of...
net_kernel:connect(a@host1),
net_kernel:connect(b@host1)
...add the following to your config:
{sync_nodes_mandatory, [a@ferdmbp, b@ferdmbp]},
{sync_nodes_timeout, 30000}
@BillBarnhill
BillBarnhill / Checkstyle pre-commit hook
Created November 23, 2015 12:09 — forked from davetron5000/Checkstyle pre-commit hook
Pre Commit Hook for running checkstyle on changed files
#!/usr/bin/perl
#
# Pre-commit hook for running checkstyle on changed Java sources
#
# To use this you need:
# 1. checkstyle's jar file somewhere
# 2. a checkstyle XML check file somewhere
# 3. To configure git:
# * git config --add checkstyle.jar <location of jar>
# * git config --add checkstyle.checkfile <location of checkfile>
@BillBarnhill
BillBarnhill / README.md
Created November 23, 2015 12:20 — forked from marchelbling/README.md
git hooks

Git hooks for better pivotal integration:

  • pre-commit:
    • prevents commiting on a branch that is not suffixed by an issue number. Some special branches (develop, master) and hotfixes are not constrained
    • [optional] lints python/js (+ beautification) files (requires to define the AUTO_LINT_FILES environment variable)
  • prepare-commit-msg: prepend issue number to commit message if it's missing and if it is set in the branch name (see pre-commit hook)
  • post-checkout: [optional] automatically update submodules when checkouting a branch (requires to define the AUTO_SUBMODULE_UPDATE environment variable)

For easy setup:

current="$( pwd )" && cd "$( git rev-parse --show-cdup )" && if [ -d .hooks ]; then cd .hooks && git fetch origin && git reset --hard origin/master && cd ..; else git clone https://gist.github.com/7358077.git .hooks; fi && if ([ ! -f .gitignore ] || ! grep .hooks .gitignore >/dev/null ); then echo -e ".hooks\n" >> .gitignore; fi && find .hooks -maxdepth 1 -type f |
@BillBarnhill
BillBarnhill / pre-receive
Created November 23, 2015 12:21 — forked from pfctgeorge/pre-receive
Git hooks
#!/env/python
# coding: utf-8
from subprocess import check_output, PIPE, Popen
import sys
import re
BADREV = "0000000000000000000000000000000000000000"