This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
public class XmlParser : IDisposable | |
{ | |
public TextReader Stream { get; private set; } | |
public string Text { get; private set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
function initialize() { | |
var latlng = new google.maps.LatLng(36.14, -115.14); | |
var myLatlng = new google.maps.LatLng(36.14,-115.14); | |
var myOptions = { | |
zoom: 12, | |
center: latlng, | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
}; | |
var map = new google.maps.Map(document.getElementById("map_canvas"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add 'node_modules' to .gitignore file | |
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var target = new Border{ Background = Brushes.SteelBlue, Width = 200, Height = 200 }; | |
var win = new Window{ Content = target }; | |
var mouseDown = Observable.FromEventPattern<MouseEventArgs>(target, "MouseLeftButtonDown"); | |
var mouseMove = Observable.FromEventPattern<MouseEventArgs>(target, "MouseMove"); | |
var mouseUp = Observable.FromEventPattern<MouseEventArgs>(target, "MouseLeftButtonUp"); | |
// dragEvents is IObservable<IObservable<EventPattern<MouseMoveEvent>>> | |
// The first dimmension represents the sequence of discrete drag "sessions" | |
// The second dimmension represents the sequence of moves within that drag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host 'Copy the package payload over to the clickonce web application location' | |
$source = ".\" | |
$dest = "C:\Octopus\Applications\${OctopusEnvironmentName}\NextGen.ClickOnce\${OctopusPackageVersion}\Package" | |
$exclude = @('*.pdb','mage.exe', '*.ps1', '*Build*', '*.pfx') | |
$appManifestName = "${OctopusPackageName}.exe.manifest" | |
$appManifestPath = Join-Path $dest $appManifestName | |
$deployManifestPath = Join-Path $dest "${OctopusPackageName}.application" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///<reference path="../../../typings/angularjs/angular-mocks.d.ts"/> | |
import {ObservableRequestService} from '../../../src/core/observable-request-service.ts'; | |
import { | |
Http, | |
ConnectionBackend, | |
BaseRequestOptions, | |
MockBackend, | |
ResponseOptions, | |
Response | |
} from 'angular2/http'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Extensions | |
{ | |
public static IObservable<TProperty> ObservePropertyChanged<TNotifier, TProperty>( | |
this TNotifier notifier, | |
Expression<Func<TNotifier, TProperty>> propertyAccessor, | |
bool startWithCurrent = false) | |
where TNotifier : INotifyPropertyChanged | |
{ | |
// Parse the expression to find the correct property name. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Call the api client like this: | |
var client = new ApiClient<SEnvelope>("https://baseurl.com/api/v1"); | |
//you would overload and add an auth_token param here | |
client.GetDtoAsync("envelopes", "object_id", (response) => //callback | |
{ | |
this.SEnvelope = response.Data;//should be an envelope from the server | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * from Source_Table; | |
select * from | |
( select | |
person, | |
country, | |
'country' + cast(rank() | |
over (partition by person order by id) | |
as varchar(10)) | |
as countryrank |