Skip to content

Instantly share code, notes, and snippets.

View lanwin's full-sized avatar
🤡
-

Steve Wagner lanwin

🤡
-
View GitHub Profile
@lanwin
lanwin / rabbit_based_message_bus.cs
Created February 14, 2012 08:30
This is an example how to use our Rabbit Service Bus.
/* Initialize bus. In this case via Autofac */
builder.RegisterModule(new RabbitModule
{
HostName = "localhost",
UserName = "user",
Password = string.Empty,
Exchanges = {
new Exchange("exchange1"){Durable=true;},
new Exchange("exchange2"){Durable=true;}
}
@lanwin
lanwin / add_users_to_projects.sh
Created February 2, 2012 08:41
Script to Automatically add all GitLab users to all projects
#!/bin/sh
baseurl=http://mygitlaburl
usermail=adminuser@mymailserver
userpass=adminpassword
repo_access=2 #0=denied 1=read 2=read&write
project_access=2 #0=deined 1=read 2=report 3=admin
# login
curl -s -I -c cookies.txt -d "utf8=✓&user[email]=$usermail&user[password]=$userpass&commit=Sign+in" $baseurl/users/sign_in
@lanwin
lanwin / gist:852890
Created March 3, 2011 15:06
Simply object extension with provides an maybe monad.
public static class ObjectExtensions
{
public static IEnumerable<T> ToMaybe<T>(this T obj)
{
return Equals(obj,null) ? Enumerable.Empty<T>() : new[] {obj};
}
}