Skip to content

Instantly share code, notes, and snippets.

View rsds143's full-sized avatar

rsds143

View GitHub Profile
log-slow-queries=/var/log/whereever/slow_queries.log
long_query_time = 1 #one second
log-queries-not-using-indexes
@rsds143
rsds143 / c3p0.hibernate.cfg.xml
Created June 26, 2010 13:44
java jdbc c3po config with connection provider
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
@rsds143
rsds143 / default_build.xml
Created June 26, 2010 15:03
default apache ivy setup
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="whatever">
<property name="hibernate.version" value="3.5.6-Final"/>
<!-- =================================
target: resolve
================================= -->
<target name="resolve" description="--> retrieve dependencies with ivy">
<ivy:retrieve />
</target>
</project>
#!/usr/bin/env ruby
f = File.new ARGV[0]
lineend = ARGV[1].to_i
counter = 0
while(line = f.gets and counter<lineend)
puts line
counter += 1
end
f.close()
@rsds143
rsds143 / nant_output_web.build
Created January 5, 2011 01:36
cause I can never find it when I need it
<?xml version="1.0"?>
<project name="foobar" default="build" basedir=".">
<description>foobar</description>
<target name="build" description="Compile Web Site.">
<exec basedir="."
program="msbuild.exe"
commandline=" MySite.csproj /nologo
/t:Rebuild
/t:ResolveReferences;_CopyWebApplication
/p:OutDir=..\..\deploymentdir\bin\
@rsds143
rsds143 / my vimrc
Created January 21, 2011 05:36
my vimrc on os x, much of which shamelessly stolen from @Armmer
" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2008 Jul 02
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
" for OpenVMS: sys$login:.vimrc
@rsds143
rsds143 / tmux.conf
Created January 21, 2011 05:39
my tmux file
# $Id: vim-keys.conf,v 1.2 2010/09/18 09:36:15 nicm Exp $
#
# vim-keys.conf, v1.2 2010/09/12
#
# By Daniel Thau. Public domain.
#
# This configuration file binds many vi- and vim-like bindings to the
# appropriate tmux key bindings. Note that for many key bindings there is no
# tmux analogue. This is intended for tmux 1.3, which handles pane selection
# differently from the previous versions
@rsds143
rsds143 / nunit_bdd.xml
Created January 27, 2011 16:35
Resharper 4.5 live templates for nunit context spec testing
<TemplatesExport family="Live Templates">
<Template uid="4ff078ab-cd76-4daa-a18a-5442545ae610" shortcut="basectx" description="base bdd context" text="[TestFixture]&#xD;&#xA; public abstract class $FILENAME$TestsBaseContext&#xD;&#xA; {&#xD;&#xA; $END$&#xD;&#xA; [SetUp]&#xD;&#xA; public void SetUp()&#xD;&#xA; {&#xD;&#xA; SpecificSetUp(); &#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; protected abstract void SpecificSetUp();&#xD;&#xA; &#xD;&#xA; &#xD;&#xA; }" reformat="True" shortenQualifiedReferences="True">
<Context>
<CSharpContext context="Everywhere" minimumLanguageVersion="3.0" />
</Context>
<Categories />
<Variables>
<Variable name="FILENAME" expression="getFileNameWithoutExtension()" initialRange="0" />
</Variables>
<CustomProperties />
@rsds143
rsds143 / ActiveDirectoryGroupFinder.cs
Created May 13, 2011 15:25
collection of tidbits I've pulled together
public class ActiveDirectoryGroupFinder
{
public string GetPrimaryGroup(DirectoryEntry aEntry)
{
var primaryGroupID = (int)aEntry.Properties["primaryGroupID"].Value;
var objectSid = (byte[])aEntry.Properties["objectSid"].Value;
var escapedGroupSid = new StringBuilder();
// Copy over everything but the last four bytes(sub-authority)
// Doing so gives us the RID of the domain
for (uint i = 0; i < objectSid.Length - 4; i++)
@rsds143
rsds143 / vimrc
Created July 27, 2011 16:14
latest vim on windows
"tabs and other goods taken from web
set hidden
set expandtab
set nowrap " don't wrap lines
set tabstop=4 " a tab is four spaces
set shiftwidth=4 " number of spaces to use for autoindenting
set backspace=indent,eol,start
" allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting