Skip to content

Instantly share code, notes, and snippets.

View drewfreyling's full-sized avatar

Drew Freyling drewfreyling

View GitHub Profile
@drewfreyling
drewfreyling / stash.ps1
Last active July 15, 2019 05:51
Update Builds and Approvers for all repos
$Credential = Get-Credential
$uri = 'https://stash.globalx.com.au/rest/api/1.0/projects?limit=100'
$projects = Invoke-RestMethod -uri $uri -Authentication Basic -Credential $Credential
ForEach ($project in $projects.values)
{
$key = $project.key
$uri = "https://stash.globalx.com.au/rest/api/1.0/projects/$key/repos?limit=500"
$repos = Invoke-RestMethod -uri $uri -Authentication Basic -Credential $Credential
@drewfreyling
drewfreyling / gist:e3145473010ecfe8d1af
Last active September 2, 2019 14:26
Refresh All SQL Modules
DECLARE @Name nvarchar(1000);
DECLARE @Sql nvarchar(1000);
DECLARE @Result int;
DECLARE ObjectCursor CURSOR FAST_FORWARD FOR
SELECT SCHEMA_NAME(o.schema_id) + '.[' + OBJECT_NAME(o.object_id) + ']'
FROM sys.objects o
WHERE type_desc IN (
'SQL_STORED_PROCEDURE',
'SQL_TRIGGER',
@drewfreyling
drewfreyling / gist:c0532071080af2a10132
Created May 29, 2014 03:56
Dropbox Chooser Require Shim
requirejs.config({
paths: {
"dropboxchooser": ["https://www.dropbox.com/static/api/2/dropins"]
},
//Remember: only use shim config for non-AMD scripts,
//scripts that do not already call define(). The shim
//config will not work correctly if used on AMD scripts,
//in particular, the exports and init config will not
//be triggered, and the deps config will be confusing
//for those cases.
private bool AnyActivitiesAnsweredYes()
{
bool answered = false;
if (Q48.SelectedItem.Text == "Yes") answered = true;
if (Q49.SelectedItem.Text == "Yes") answered = true;
if (Q50.SelectedItem.Text == "Yes") answered = true;
if (Q51.SelectedItem.Text == "Yes") answered = true;
if (Q52.SelectedItem.Text == "Yes") answered = true;
if (Q53.SelectedItem.Text == "Yes") answered = true;
@drewfreyling
drewfreyling / JSON
Last active December 25, 2015 18:09
[TestMethod]
public void DeserializeTest()
{
const string json = "{\"a\":\"test\"}"; //already stringifyied
var result = ServiceStack.Text.JsonSerializer.DeserializeFromString<dynamic>(json);
Assert.AreEqual("test", result.a);
}
[TestMethod]
public void SerializeTest()
public interface IJobOrderClientContactLegacyService
{
[OperationContract]
[FaultContract(typeof(MessageFault))]
[FaultContract(typeof(ValidationFault))]
[FaultContract(typeof(DataFault))]
[FaultContract(typeof(ServiceFault<ErrorCodeEnum>))]
int SaveJobOrderClientContact(Guid jobOrderId, Guid clientContactId, Guid createdByUserId, int jobOrderClientContactTypeId);
}