Skip to content

Instantly share code, notes, and snippets.

@rhysgodfrey
rhysgodfrey / gist:4413111
Created December 30, 2012 14:47
Telligent Enterprise Simple Redirect to Login Scripted Content Fragment
#set($urlName = $core_v2_urls.Current)
#set($isRegistered = $core_v2_user.IsRegistered($core_v2_user.Accessing.Id))
## List of pages anonymous users are allowed to access
#set($allowedPages = [ "LogIn", "LogOut", "Message", "GetForgottenPassword", "AddUser" ])
#if(!$isRegistered && !$allowedPages.Contains($urlName))
$core_v2_page.Redirect($core_v2_urls.LogIn())
#end
@rhysgodfrey
rhysgodfrey / ActivityRepository.cs
Created January 30, 2013 22:30
The Activity Repository takes a list of updates and maps this to a card entering and leaving a board (some of this logic is a bit hacky). This then gives the set of Lists on the board, with when each card was added to the list (and when it left, if it has). The Cumulative Flow Model then takes this information to decide how many cards are in eac…
using Chello.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TrelloCFD.Factories;
using Chello.ScrumExtensions;
namespace TrelloCFD.Domain
{
@rhysgodfrey
rhysgodfrey / CreateWithSchema.sql
Created July 24, 2014 09:08
Telligent Community 6.1 SQL Install - Non DBO Schema
Print 'Creating...te_vw_ModerationAction'
SET QUOTED_IDENTIFIER ON;
SET ANSI_NULLS ON;
GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[te_vw_ModerationAction]') AND OBJECTPROPERTY(id, N'IsView') = 1)
DROP VIEW [dbo].[te_vw_ModerationAction]
GO
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"ElasticBeanstalkEnvironmentPermissions",
"Effect":"Allow",
"Action":[
"elasticbeanstalk:DescribeEnvironmentResources",
"elasticbeanstalk:DescribeEnvironments",
"elasticbeanstalk:DescribeEvents",
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"EC2EnvironmentInstances",
"Effect":"Allow",
"Action":[
"ec2:MonitorInstances",
"ec2:UnmonitorInstances",
"ec2:RebootInstances",
{
"Statement":[
{
"Effect":"Allow",
"Action":[
"s3:ListAllMyBuckets"
],
"Resource":"arn:aws:s3:::*"
},
{
$server = '.'
$database = 'MyDatabase'
$s3Bucket = 's3-sql-backups'
$backupPath = 'C:\SqlBackup\'
$region = 'eu-west-1'
# accessKey and secretKey can be removed if running on an EC2 instance and using IAM roles for security
$accessKey = 'USER-ACCESS-KEY'
$secretKey = 'USER-SECRET-KEY'
$timestamp = get-date -format yyyyMMddHHmmss
# The version number for this release
$versionNumber = $Env:APPVEYOR_BUILD_VERSION
# The Commit SHA for corresponding to this release
$commitId = $Env:APPVEYOR_REPO_COMMIT
# The notes to accompany this release, uses the commit message in this case
$releaseNotes = $Env:APPVEYOR_REPO_COMMIT_MESSAGE
# The folder artifacts are built to
$artifactOutputDirectory = $Env:APPVEYOR_BUILD_FOLDER
# The name of the file to attach to this release
$artifact = 'xunit-build-runner.zip'
@rhysgodfrey
rhysgodfrey / S3FullAccess.json
Created September 29, 2014 13:18
Full access to a specific S3 bucket - replace "bucket-name" with name of the bucket
{
"Statement":[
{
"Effect":"Allow",
"Action":[
"s3:ListAllMyBuckets"
],
"Resource":"arn:aws:s3:::*"
},
{
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Global",
"Effect": "Allow",
"Action": [
"rds:DescribeEngineDefaultParameters",
"rds:DescribeDBInstances",
"rds:DescribeDBParameterGroups",