Skip to content

Instantly share code, notes, and snippets.

View jmarnold's full-sized avatar

Josh Arnold jmarnold

View GitHub Profile
@jmarnold
jmarnold / bottle
Created December 23, 2011 07:48
Package Manifests
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Role>module</Role>
<Name>MyBottle</Name>
<DataFileSet Include="*.*">
<DeepSearch>true</DeepSearch>
</DataFileSet>
<ContentFileSet Include="Shared/*.spark;Shared/*.xml;Content/*.*;*.config;Features/*.spark;">
<DeepSearch>true</DeepSearch>
</ContentFileSet>
</package>
@jmarnold
jmarnold / .links
Created December 23, 2011 07:09
sample bottle links
@jmarnold
jmarnold / .fubunew-alias
Created December 17, 2011 05:51
.fubunew-alias sample
<?xml version="1.0"?>
<aliases xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Aliases>
<alias name="my-template" url="git://my-template.git" />
</Aliases>
</aliases>
@jmarnold
jmarnold / example.js
Created November 10, 2011 16:43
Dependencies in Backbone
Model = Backbone.Model.extend({
initialize: function () {
this.dependentProperty('y', function () {
return this.get('x') * 100;
});
}
});
@jmarnold
jmarnold / common.js
Created November 7, 2011 21:08
Backbone testing fun
var Logistics = (function () {
var self = {
windowService: {
refresh: function () {
window.location.reload();
},
navigateTo: function (url) {
window.location = url;
}
}
@jmarnold
jmarnold / sample-tests.js
Created November 2, 2011 05:54
Sample Jasmine Specs
describe('NavigatePolicyTester', function () {
var policy;
beforeEach(function () {
policy = new Logistics.Ajax.NavigatePolicy();
});
it('should_match_when_continuation_specifies_navigate', function () {
expect(policy.matches({ navigatePage: 'www.google.com' })).toEqual(true);
});
@jmarnold
jmarnold / routing.js
Created October 21, 2011 02:46
An old js dsl example
jBus.routing = new (function() {
function lazy(builder) {
this.builder = builder;
this.buildWith = function(func) {
this.builder = func;
};
this.value = function() {
return this.builder();
};
@jmarnold
jmarnold / CreateEntityAction.cs
Created October 16, 2011 03:01
Action Discovery
public class CreateEntityAction<TEntity>
where TEntity : IDomainEntity
{
public CommandResult<TEntity> Execute(CreateEntityModel<TEntity> input)
{
// do generic stuff
}
}
@jmarnold
jmarnold / gm.sh
Created October 12, 2011 04:35
The Good Morning Command
# the good-morning command (where upstream is your target remote -- or could be origin)
function gm {
branch_name="$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1 /')"
echo "Currently on $branch_name"
git checkout master
git pull upstream master
git checkout $branch_name
git rebase master
}
public interface IPackageInfo
{
string Name { get; }
string Role { get; set; }
void LoadAssemblies(IAssemblyRegistration loader);
void ForFolder(string folderName, Action<string> onFound);
void ForData(string searchPattern, Action<string, Stream> dataCallback);
}