Skip to content

Instantly share code, notes, and snippets.

@tkowalczyk
tkowalczyk / GetClosestSkeleton
Created March 25, 2014 19:10
Get closest skeleton from all of the tracked skeletons
private static Skeleton GetClosestSkeleton(Skeleton[] skeletons)
{
return skeletons
.Where(skeleton => skeleton.TrackingState == SkeletonTrackingState.Tracked)
.OrderBy(skeleton => skeleton.Position.Z).FirstOrDefault();
}
@tkowalczyk
tkowalczyk / All TTS languages installed
Created April 13, 2013 09:35
This method list all of the installed languages which we can use in TTS applications.
private void InstalledLang()
{
using (SpeechSynthesizer synth = new SpeechSynthesizer())
{
// Output information about all of the installed voices.
Console.WriteLine("Installed voices -");
foreach (InstalledVoice voice in synth.GetInstalledVoices())
{
VoiceInfo info = voice.VoiceInfo;
@tkowalczyk
tkowalczyk / To admin only
Created January 16, 2013 11:33
This gist allow using http://wordpress.org/extend/plugins/private-messages-for-wordpress/ plugin for sending private messages only to Administrator from users. Source code of send-page.php of this plugin.
<?php
/**
* Send form page
*/
function rwpm_send()
{
global $wpdb, $current_user;
?>
<div class="wrap">
<h2><?php _e( 'Send Private Message', 'pm4wp' ); ?></h2>