Skip to content

Instantly share code, notes, and snippets.

View jonnii's full-sized avatar
:shipit:
<--- lets do this

Jonathan Goldman jonnii

:shipit:
<--- lets do this
View GitHub Profile
$workingDirectory = $args[0]
$machine = $args[1]
$environment = $args[2]
$configuration = $args[3]
Set-Location $workingDirectory
# read the version file, which indicates which version we're going to deploy
$versionFile = resolve-path ../Version
$version = Get-Content $versionFile
App.Application = Ember.Object.extend({
hasUnread: false,
name: null,
environment: null,
shortEnvironment: function () {
var env = this.get('environment');
if (env == 'development') {
return 'dev';
}
source: Em.Route.extend({
route: '/source/:application_id',
connectOutlets: function (router, application) {
router.set('navigationController.selected', 'logs');
router.get('applicationController').connectOutlet('source', application);
},
deleteApplication: function (router) {
var application = router.get('sourceController').get('content');
application.deleteRecord();
App.store.commit();
public HttpResponseMessage Post(IEnumerable<Message> messages)
{
try
{
Logger.Info("POST MessagesController::Create");
if (messages.Any(m => !m.IsValid))
{
return new HttpResponseMessage(HttpStatusCode.BadRequest)
{
public class Application : IIdentifiable
{
public ObjectId Id { get; set; }
public string Name { get; set; }
public string Environment { get; set; }
public long TotalMessages { get; set; }
public class MessageHeader : IMessageHeader
{
public MessageHeader()
{
}
public MessageHeader(string message)
{
Body = message;
}
subscribe: function (connection) {
console.log(" -> subscribing to application updates");
var subscriber = connection.applicationHub;
var store = App.store;
subscriber.client.applicationUpdated = function (data) {
data.forEach(function (d) {
var persisted = store.find(App.Application, d.id);
persisted.set('last_message', d.last_message);
@jonnii
jonnii / gist:3873727
Created October 11, 2012 16:40
awful hack
$('.button').each(function () {
var location = $(this).attr('href');
$(this).click(function (e) {
var image = $('<img/>');
image.error(function () {
window.location = location;
}).load(function () {
window.location = location;
}).attr('src', location);
@jonnii
jonnii / gist:3867914
Created October 10, 2012 19:39
updae query
public class UpdateJobIsPinned : IUpdate<Job, bool>
{
public UpdateJobIsPinned(string id, bool isPinned)
{
Id = id;
IsPinned = isPinned;
}
public string Id { get; private set; }
@jonnii
jonnii / gist:3867894
Created October 10, 2012 19:35
mongo repo
/// <summary>
/// Repository interface
/// </summary>
public interface IMongoRepository
{
/// <summary>
/// Indicates whether or not the repository can connect to the underlying
/// mongo instance
/// </summary>
bool CanConnect { get; }