This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
require 'fake_web' | |
class LeadControllerTest < ActionController::TestCase | |
context "given a valid url to preform a search" do | |
setup do | |
FakeWeb.register_uri(:any, "http://thesoftwaresimpleton.blogspot.com/", :body => "sample.html") | |
login_as_standard_user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected ViewResult SaveItemWithParent<T, U>(string structureName, Guid? uid, Guid? parentUid, string parentStructureType, | |
Func<Guid, T> loadItem, Action<T, Guid> setParent, Func<ViewResult> all, string structureType) | |
where T : StructureBase, IParent<U>, new() | |
where U : StructureBase, new() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public virtual T GetByExpression<T>(Expression<Func<T, bool>> expression) where T : class | |
{ | |
var session = _sessionManager.OpenSession(); | |
var result = session.QueryOver<T>() | |
.Where(expression) | |
.List() | |
.FirstOrDefault(); | |
return result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [master] | |
DECLARE @DatabaseName nvarchar(50) | |
SET @DatabaseName = N'ncontinuity2' | |
DECLARE @SQL varchar(max) | |
SET @SQL = '' | |
SELECT @SQL = @SQL + 'Kill ' + Convert(varchar, SPId) + ';' | |
FROM MASTER..SysProcesses | |
WHERE DBId = DB_ID(@DatabaseName) AND SPId <> @@SPId |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host git.github.com | |
User git | |
IdentityFile ~/.ssh/id_rsa | |
Host git.assembla.com | |
User git | |
IdentityFile ~/.ssh/id_rsa_assembla |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
email = [email protected] | |
name = paul.cowan | |
[core] | |
autocrlf = false | |
[merge] | |
tool = tortoisemerge | |
[mergetool "tortoisemerge"] | |
cmd = C:/Program Files/TortoiseGit/bin/TortoiseMerge.exe -base:$BASE -mine:$LOCAL -theirs:$REMOTE -merged:$MERGED |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$snapins = Get-PSSnapin -Registered | |
$snapins | Add-PSSnapin | |
Get-Module -ListAvailable | Import-Module | |
Get-PSSnapin | Format-Table -autosize PSVersion, Name | |
Get-Module | Format-Table -autosize ModuleType, Name | |
function ff ([string] $glob) { get-childitem -recurse -include $glob } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
dir = Rails.root.join('public/javascripts/app/templates/') | |
Dir["#{dir}**/*.*"].each do |path| | |
%> | |
<% | |
template = File.read(path) | |
name = path.gsub(dir.to_s, '').sub(File.extname(path), '') | |
%> | |
<script name="<%= name %>" type="text/x-js-template"><%= template.html_safe %></script> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadTemplates: function() { | |
var templates = {}; | |
$('*[type="text/x-js-template"]').map(function() { | |
var name = $(this).attr('name'); | |
var source = $(this).html().replace('>', '>'); | |
if(name.split('/')[1][0] == '_') { Handlebars.registerPartial(name.replace('/', ''), source) } | |
templates[name] = Handlebars.compile(source); | |
}); | |
return templates; | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Observation extends Backbone.Model | |
class Observations extends Backbone.Collection | |
model: Observation | |
class ObservationsView extends Backbone.View | |
el: $('#observations') | |
constructor: -> | |
@url = _observationsUrl |