Skip to content

Instantly share code, notes, and snippets.

View worldspawn's full-sized avatar

Sam Critchley worldspawn

  • Melbourne, Australia
View GitHub Profile
@worldspawn
worldspawn / 4k gtx 9 series
Last active August 29, 2015 14:22
Compare 9 series cards for a 4k setup
GTX 970 (x3) - $1677
Total Ram --- 12, Total Cores - 4992, Total GigaTexels/s - 327, Total Watts - 435
(Scaled) --- GigaTexels/s - 250, GTS/Watt - 0.57, GTS/$ - 0.15
Value Score --- 1.02
GTX 980 (x2) - $1558
Total Ram --- 8, Total Cores - 4096, Total GigaTexels/s - 288, Total Watts - 330
(Scaled) --- GigaTexels/s - 274, GTS/Watt - 0.83, GTS/$ - 0.18
Value Score --- 1.16
@worldspawn
worldspawn / sample.cs
Created May 19, 2015 01:24
Protected+Audited domain actions
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Manager
{
class Program
{
@worldspawn
worldspawn / jsdi.js
Last active August 29, 2015 14:20
JS Di COntainer
module.exports = function (Q) {
function Builder() {
this.registrations = {};
}
Builder.prototype = {
register: function (name, factory, lifecycle) {
lifecycle = lifecycle || 'perdependency';
if (!this.registrations[lifecycle]) {
this.registrations[lifecycle] = {};

Does a rudimentary merge. It uses the pofile package to read po files. It adds missing entries from pot files to po files and replaces existing entries references and extracted comments. Usage example is at the bottom.

  • Added a lookup to check for entries in the po file that cannot be found in the catalog. If an entry is not found a comment is added indicating that, if the entry is found then if that comment is there it is removed.
@worldspawn
worldspawn / twoWayBinder
Last active August 29, 2015 14:16
Two Way Binder - For use in non-isolated scope scenarios
.factory('twoWayBinder', function ($parse) {
function twoWayBind($scope, remote, local){
var remoteSetter = $parse(remote).assign;
var localSetter = $parse(local).assign;
$scope.$watch(remote, function (value) {
localSetter($scope, value);
});
$scope.$watch(local, function (value) {
@worldspawn
worldspawn / gist:7983836
Created December 16, 2013 08:24
Bitta APIARY

Group Flavours

Flavour related resources of Mealstrom API

Flavour Collection [/flavours]

A collection of flavours

  • Model

    HAL + JSON representation of flavour resource