Skip to content

Instantly share code, notes, and snippets.

View jkodroff's full-sized avatar

Josh Kodroff jkodroff

View GitHub Profile
@jkodroff
jkodroff / gist:2706501
Created May 16, 2012 01:13
Ratanagiri Proposed Site Structure

General Notes

  • The index for the site is a splash page with the picture of the monk alone on the hill (per Aj. Munindo's wishes to get folks to slow down).
  • Josh thinks we should try to keep the navigation as flat as possible (i.e. not nesting more than 2 deep) and put more content on a single page for greater usability.
  • Photo galleries should be keyboard-navigable (hit the right arrow to move forward, left arrow to move back)
  • Josh omitted the links page because they've fallen out of use in favor of links within content itself.
  • Josh likes the idea of a random (or monthly) Dhp verse, possibly in the footer, but this would require dynamic content, which he believes Jekyll can't do.

#Page Layout:

  • 960 (or so) px width. (The current site is about 850 px, but 960 is fairly standard.)
  • Main navigation across top of page (like http://www.abhayagiri.org, but bigger fonts)
@jkodroff
jkodroff / customerFindAsYouType.js
Created July 18, 2012 22:31
jQuery UI Autocomplete example with complex objects
/// <reference path="../../jquery-1.6.4-vsdoc.js" />
(function ($) {
WEBLINC.areas.add('customerFindAsYouType', function () {
(function () {
WEBLINC.widgets.add('customerFindAsYouType', function (scope) {
$('.customerfindasyoutype', scope)
.keypress(function (e) {
if (e.keyCode == 13) {
@jkodroff
jkodroff / gist:3751537
Created September 19, 2012 19:03
Using ASP.NET MVC with StructureMap
Global.asax.cs:
public class MvcApplication : HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
// ...
ControllerBuilder.Current.SetControllerFactory(new StructureMapControllerFactory());
}
StructureMapControllerFactory.cs
@jkodroff
jkodroff / gist:4999695
Created February 20, 2013 21:17
Psake snippet - Deploying an NServiceBus Endpoint
task ServiceEndpoints {
deploy_endpoint "RelocationMoverServices.Synergize.Handlers"
}
function global:deploy_endpoint($name) {
$project = "$BaseDir\src\$name\$name.csproj"
$buildPath = "$DeployBaseDir\$name"
$deployPath = "c:\ReloDotNet2_ServiceEndpoints\$name"
@jkodroff
jkodroff / gist:8561491
Created January 22, 2014 16:08
NServiceBus endpoint that handles email
using System;
using System.Configuration;
using System.Net;
using System.Text;
using NServiceBus;
using Newtonsoft.Json;
using RestSharp;
public class SendEmailHandler : IHandleMessages<SendEmail>
{
package objsets
import common._
import TweetReader._
/**
* A class to represent tweets.
*/
class Tweet(val user: String, val text: String, val retweets: Int) {
override def toString: String = text
@jkodroff
jkodroff / handlebars_helpers.js
Created June 10, 2014 18:10
Some handlebars helpers I find useful.
Handlebars.registerHelper('json', function(obj) {
return JSON.stringify(obj);
});
Handlebars.registerHelper('fixed', function(obj) {
return obj.toFixed(2);
});
Handlebars.registerHelper('encode', function(obj) {
return encodeURIComponent(obj);
@jkodroff
jkodroff / handlebars_helpers.js
Created June 10, 2014 18:10
Some potentially useful handlebars helpers.
Handlebars.registerHelper('json', function(obj) {
return JSON.stringify(obj);
});
Handlebars.registerHelper('fixed', function(obj) {
return obj.toFixed(2);
});
Handlebars.registerHelper('encode', function(obj) {
return encodeURIComponent(obj);
POST file to /songs:
{
id: UUID,
bytes: byte[],
title: // blah blah
}
express method handle POST request:
put the POST data in the transcoding message queue with message type "encodeSong"
var myFunction(someObject, the, arguments) {
};
// with tap
$('selector')
.tap(myFunction, the, arguments)
.hide();
// without tap
var $collection = $('selector')