Skip to content

Instantly share code, notes, and snippets.

@teyc
teyc / LayoutAnimator.java
Last active May 24, 2020 09:52
JavaFX helper which slides elements inside a layout into its final position
package javafxapplication1;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javafx.animation.Transition;
import javafx.animation.TranslateTransition;
import javafx.beans.property.DoubleProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
@teyc
teyc / MainPage.xaml
Created November 2, 2013 10:46
Syncfusion DomainDataGridControl Exercises
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:syncfusionria="clr-namespace:Syncfusion.Windows.Controls.Grid.Ria;assembly=Syncfusion.Grid.Ria.Silverlight"
xmlns:syncfusion="clr-namespace:Syncfusion.Windows.Controls.Grid;assembly=Syncfusion.Grid.Silverlight"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
xmlns:web="clr-namespace:SilverlightSyncfusionGridTest.Web"
@teyc
teyc / .gitignore
Last active August 29, 2015 13:57
Caliburn Micro Conductor Stackoverflow Question
obj/
Bin/
Properties/
Tests/
@teyc
teyc / index.html
Created January 15, 2015 22:40
Load scripts relative to Sharepoint Site Collection
<!doctype html>
<html>
<script type="text/javascript" src="spLoadScripts.js">
Readify.SiteUrl = "/sites/MySite";
Readify.loadScriptsAsync(
"SiteAssets/pageStyle.css",
"SiteAssets/lodash.js"
);
</script>
</html>
@teyc
teyc / HomeModule.cs
Created February 15, 2015 10:12
Using Nancy with CoreCLR (doesn't work)
namespace WebApplication1
{
using Nancy;
public class HomeModule: NancyModule
{
public HomeModule()
{
Get["/"] = _ => "Goodbye from Nancy";
}
@teyc
teyc / DropDatabase.cs
Last active January 5, 2017 23:55
ResetTheWorld
using System.Data.SqlClient;
using DbUp;
using DbUp.Builder;
using DbUp.Engine.Output;
using Serilog;
namespace JJRichards.JTrack.Domestic.DCMSMasterMock.Migrations.Serilog
{
internal static class DbUpExtensions
{
public class CustomHostFactory : ServiceHostFactory
{
protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
{
ServiceHost host = new ServiceHost(serviceType, baseAddresses);
// ... now can configure endpoints programmatically if required
return host;
}
@teyc
teyc / DbUp.csproj
Last active August 29, 2015 14:23 — forked from sheastrickland/DbUp.csproj
MSBuild convention checks
<Target Name="AfterBuild">
<Message Text="@(Content)" Importance="high" Condition="%(Content.Extension) == '.sql'" />
<Error Condition="%(Content.Extension) == '.sql'" Text="Nothing should be marked as Content, check your scripts are marked as Embedded Resource" />
</Target>
@teyc
teyc / gist:8eea5e9afc027bd2da6a
Last active August 29, 2015 14:27
Converts from music notes to number of semitones
type Notes =
| A = 0
| ASharp = 1
| B = 2
| C = 3
| CSharp = 4
| D = 5
| DSharp = 6
| E = 7
| F = 8