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
@jonnii
jonnii / LoggingFacility.cs
Created November 15, 2017 14:50
logging facility
public class LoggingFacility : AbstractFacility
{
private ILogger logger;
protected override void Init()
{
if (logger == null)
{
return;
}
Verifying my Blockstack ID is secured with the address 1L2jH35xqFjgh7yHHThg3bkaSNsp78UqY9 https://explorer.blockstack.org/address/1L2jH35xqFjgh7yHHThg3bkaSNsp78UqY9
{{#each breadcrumb}}
<li {{bind-attr class="isActive:active"}}>
{{#if link}}
{{#link-to link}}{{text}}{{/link-to}}
{{else}}
{{text}}
{{/if}}
</li>
{{/each}}
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
namespace AyendeTest
{
[TestFixture]
public class Class1
{
module Middleware
# this class cheats and bypasses rails altogether if the client attempts
# to download a static asset
class TurboDev
def initialize(app, settings={})
@app = app
end
def call(env)
# hack to bypass all middleware if serving assets, a lot faster 4.5 seconds -> 1.5 seconds
if (etag = env['HTTP_IF_NONE_MATCH']) && env['REQUEST_PATH'] =~ /^\/assets\//
public void Request<TRequest, TResponse>(TRequest message, Action<TResponse> onResponse)
where TRequest : ICorrelated
where TResponse : ICorrelated
{
var requester = CreateRequester<TRequest, TResponse>();
requester.Request(message, response =>
{
onResponse(response);
requester.Dispose();
});
Ember.Handlebars.registerBoundHelper 'timeSince', (value) ->
m = moment(value).fromNow()
return new Handlebars.SafeString('<span data-livestamp="' + value + '">' + m + '</span>')
@jonnii
jonnii / gist:5065804
Created March 1, 2013 16:27
copy build support.
param($installPath, $toolsPath, $package)
# notify the user we're going to be doing something destructive
# find out where to put the files, we're going to assume that the
# solution file is in a ./src directory and we want to put
# everything in a ./build directory at the same level.
$rootDir = (Get-Item $installPath).parent.parent.parent.fullname
$deployTarget = "$rootDir\deploy\support\"
@jonnii
jonnii / gist:5051431
Created February 27, 2013 20:31
octopus powershell iis app pool and web site settings.
Import-Module WebAdministration
###########################
# externally configured variables
###########################
$subdomain = 'subdomain' # e.g. subdomain.yourdomain.com
$appPoolName = 'Awesome App Pool!!!'
$appPoolFrameworkVersion = "v4.0"
$domain = 'yourdomain.com'
@jonnii
jonnii / foo.coffee
Created February 14, 2013 20:26
avoid refreshing ember flicker ui.
App.WorkersIndexController = Ember.ArrayController.extend
refresh: ->
console.log 'refreshing workers'
@set 'refreshing', App.Worker.find()
update: (->
refreshing = @get 'refreshing'
return unless refreshing.get('isLoaded')
Ember.run =>
@set 'content', refreshing