Skip to content

Instantly share code, notes, and snippets.

View monoblaine's full-sized avatar

Serhan Apaydın monoblaine

View GitHub Profile
@pedroreys
pedroreys / query.sql
Last active February 11, 2021 07:38
SQL Server version of this recursive query example to traverse a tree depth-first http://jakub.fedyczak.net/post/postgresql-with-recursive-tree-traversing-example/
declare @empl table(name nvarchar(max) null, boss nvarchar(max) null);
insert into @empl values ('Paul',null);
insert into @empl values ('Luke','Paul');
insert into @empl values ('Kate','Paul');
insert into @empl values ('Marge','Kate');
insert into @empl values ('Edith','Kate');
insert into @empl values ('Pam','Kate');
insert into @empl values ('Carol','Luke');
insert into @empl values ('John','Luke');
@rogeralsing
rogeralsing / gist:73bb7441c1e794e7497c
Created January 29, 2015 13:27
activator vs expression
using System;
using System.Diagnostics;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
namespace ConsoleApplication10
{
internal delegate T ObjectActivator<out T>(params object[] args);
@gitaarik
gitaarik / git_submodules.md
Last active July 16, 2024 09:42
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@jaz303
jaz303 / find_dirty_gits
Created October 21, 2013 19:02
find all dirty git repos under the current working directory
#!/bin/bash
for dir in $(find . -name '.git' -type d)
do
dir=$(dirname $dir)
cd $dir
STATE=""
if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
$OutputEncoding = New-Object -typename System.Text.UTF8Encoding
[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding