Skip to content

Instantly share code, notes, and snippets.

View jmeridth's full-sized avatar
:shipit:
pushing buttons on my keyboard

Jason Meridth jmeridth

:shipit:
pushing buttons on my keyboard
View GitHub Profile
@jmeridth
jmeridth / .gitignore
Created March 29, 2011 20:55
gitignore file for C# project
~
build/
[Bb]in
[Dd]ebug*/
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult
[Bb]uild[Ll]og.*
*.swp
@jmeridth
jmeridth / gist:833943
Created February 18, 2011 16:37
uritempalte_querystring_error.txt
The UriTemplate '/blah/search?{key}={value}' is not valid; each portion of the query string must be of the form 'name' or of the form 'name=value', where name is a simple literal. See the documentation for UriTemplate for more details.
@jmeridth
jmeridth / gist:800658
Created January 28, 2011 18:01
force_team_city_build.rb
# figure out your teamcity build url via help from http://bit.ly/dAFVO3
# make sure you install curl.exe from http://bit.ly/dT7Ove
url="http://user:password@host/httpAuth/action.html?add2Queue=bt#
system("C:\\curl.exe --insecure #{url} > NUL")
@jmeridth
jmeridth / gist:797123
Created January 26, 2011 18:02
get_min_max_count.rb
get '/:min/:max/:count' do |min, max, count|
defaults = {"count" => 10, "min" => 1, "max" => 100}
%w(count min max).each do |i|
default = defaults[i]
value = eval(i)
value = default if value.length > 5
value = Integer(value) rescue default
eval "#{i} = #{value}"
end
@jmeridth
jmeridth / BootStrapper.cs
Created January 6, 2011 16:41
bootstrapping structuremap and log4net
using System;
using System.IO;
using log4net;
using log4net.Config;
using StructureMap;
namespace Common.Infrastructure
{
public static class BootStrapper
{
@jmeridth
jmeridth / wcf_handle_bad_proxy_call.cs
Created December 29, 2010 16:19
wcf finally block to ensure channel is aborted
//example:
Service<IProxyInterface>.Use(service => service.MyAwesomeMethodCall());
//code:
public static class Service<T>
{
public static ChannelFactory<T> _channelFactory = new ChannelFactory<T>("");
public static void Use(Action<T> block)
{
@jmeridth
jmeridth / git_pre-receive.rb
Created December 20, 2010 19:49
git jira regex and issue existence pre-receive hook
require 'rubygems'
require 'savon'
require 'grit'
jira_address = "http://host:8080"
jira_username= "user"
jira_password = "password"
repo = Grit::Repo.new(".")
while (input = STDIN.read) != ''
@jmeridth
jmeridth / assembly_info_error.txt
Created December 8, 2010 16:33
for some reason the assembly generation loop is going one more time than expected
FIXED thanks to quick look by Derick Bailey @derickbailey. generate_assemblyinfo task needed to be a rake task and not assemblyinfo task. easy fix.
### versions.yml
files:
- OneAssemblyInfo: 1.0.0
- TwoAssemblyInfo: 2.0.0
- ThreeAssemblyInfo: 3.0.0
- FourAssemblyInfo: 4.0.0
- FiveAssemblyInfo: 5.0.0
@jmeridth
jmeridth / zip_tasks.rb
Created December 3, 2010 03:17
rake zip task vs albacore zip task
# BY HAND
def create_zip(filename, root, excludes=/^$/)
root = root + "/" if root[root.length - 1].chr != "/"
Zip::ZipFile.open(filename, Zip::ZipFile::CREATE) do |zip|
Find.find(root) do |path|
next if path =~ excludes
zip_path = path.gsub(root, '')
zip.add(zip_path, path)
end
@jmeridth
jmeridth / reinstall_rvm_1.9.2
Created November 2, 2010 05:33
rvm packages oneliner install
rvm package install readline && rvm package install iconv && rvm package install zlib && rvm package install openssl && rvm install 1.9.2 --with-readline-dir=$rvm_path/usr --with-iconv-dir=$rvm_path/usr --with-zlib-dir=$rvm_path/usr --with-openssl-dir=$rvm_path/usr