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
| module Kernel | |
| def maybe(*path) | |
| return path.inject(self) do |obj, method| | |
| return nil if obj.nil? | |
| if method.respond_to? :keys | |
| obj.send(method.first[0], *method.first[1]) | |
| else | |
| obj.respond_to?(:keys) ? obj[method] : obj.send(method) | |
| end | |
| 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
| @ECHO OFF | |
| SET IIS="c:\Program Files (x86)\IIS Express\iisexpress.exe" | |
| SET ARG=%1 | |
| REM Default to curret directory if no path provided | |
| IF [%ARG%] == [] ( | |
| SET root=%CD% | |
| GOTO launch | |
| ) ELSE ( |
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
| using DovetailCRM.Core.Authorization; | |
| using DovetailCRM.Core.Domain.Workflow; | |
| using FubuFastPack.Querying; | |
| using FubuMVC.Core.Security; | |
| namespace DovetailCRM.Core.Web.Query | |
| { | |
| public class SensitiveCaseDataRestriction : IDataRestriction<Case> | |
| { | |
| public void Apply(IDataSourceFilter<Case> filter) |
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
| unless ENV["BUILD_NUMBER"] # do not use growl when running on the CI server | |
| task :growl do | |
| Rake::Application.growl | |
| end | |
| module Rake | |
| class Application | |
| # override task execution so that growl task is always called last | |
| alias :raw_top_level :top_level |
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
| BACKUP DATABASE MyDbName TO DISK = 'C:\MSSQL\Backup\mydbname_backup.bak' | |
| RESTORE DATABASE MyDbName FROM DISK = 'C:\MSSQL\Backup\mydbname_backup.bak' WITH RECOVERY, REPLACE |
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
| get-project -all | %{ $_.Properties | ?{ $_.Name -eq "WebApplication.StartWebServerOnDebug" } | %{ $_.Value = "False"} } |
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 static class SystemClock | |
| { | |
| static SystemClock() | |
| { | |
| Live(); | |
| } | |
| public static DateTime Now | |
| { |
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
| Assumes Resharper IntelliJ/IDEA Resharper keybindings | |
| Create a new ASP.NET MVC Web application (Internet) | |
| Open HomeController.cs and start typing outside of HomeController, but within the namespace: | |
| cl[Tab]WorkController[Enter] | |
| p[Tab]Ac[Tab]Show(){[Enter] | |
| return _workflowService.GetResult();[Enter] | |
| *position cursor on _workflowService |
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
| @ECHO OFF | |
| SETLOCAL | |
| SET VERSION=%1 | |
| SET NUGET=buildsupport\nuget.exe | |
| FOR %%G IN (packaging\nuget\*.nuspec) DO ( | |
| %NUGET% pack %%G -Version %VERSION% -Symbols -o artifacts | |
| ) |
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
| desc "Downloads from CI and pushes nuget packages to the official feed" | |
| task :release, [:package] do |t, args| | |
| require 'open-uri' | |
| release_path = "#{buildsupport_path}/nuget_release" | |
| clean_dir release_path | |
| # The @teamcity_build_id is a unique identifier for the build configuration (looks like "bt234"). You can usually figure it out from your project url | |
| artifact_url = "http://teamcity.codebetter.com/guestAuth/repository/downloadAll/#{@teamcity_build_id}/.lastSuccessful/artifacts.zip" | |
| puts "downloading artifacts from teamcity.codebetter.com" | |
| artifact = open(artifact_url) |