As I have no idea what to talk about at buildstuff this year, I want to give you the opportunity to decide:
- Fork the gist.
- Change the title/text into a proper abstract.
- Mention it on twitter to me (@tojans)
git config --global push.default tracking | |
git config --global branch.autosetuprebase always | |
git config --local branch.master.rebase true |
var declaration = require('./declaration'); | |
declaration(); | |
// --> assertion error 3 is not equal to 4 | |
declaration({ | |
assert: { | |
equal: function () { | |
return true; | |
} |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
if [ -n "$1" ]; then | |
file=$1 | |
else | |
file=( $(ls -xt *.sln | head -n1)) | |
fi | |
if [ -z "$file" ]; then | |
echo "No solution found." | |
exit 1 | |
fi | |
/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 11.0/Common7/IDE/devenv.exe "$file" & |
At the boundaries of an application it is often nice to map objects from one form to another. The most common example is mapping domain entities to view models, or mapping to dtos for network transfer.
Automapper is a library for removing the duplication from object-object mapping code by mapping by convention. When the conventions don't map the way you want you can explicitly map properties.
After using AutoMapper on a couple of projects I have stopped using it. The problem is that the convention based mappings introduce annoying bugs when property names change or the object graph changes. When a change breaks the convention it results in a runtime exception. Very annoying.
What I Do Instead
function sendError(message, url, lineNum) { | |
var i; | |
// First check the URL and line number of the error | |
url = url || window.location.href; | |
lineNum = lineNum || 'None'; | |
// If the error is from these 3rd party script URLs, we ignore | |
// We could also just ignore errors from all scripts that aren't our own | |
var scriptURLs = [ |
$(function() { | |
$('div.content').live('showoff:show', function(evt) { | |
var bg_img = $('img[alt=background]', evt.target); | |
var old_bg = ''; | |
if (bg_img.size() > 0) { | |
var src = bg_img.attr('src'); | |
bg_img.hide(); | |
// Set new background on body | |
old_bg = $('body').css('background-image'); | |
$('body') |