Skip to content

Instantly share code, notes, and snippets.

View agross's full-sized avatar
🔪
Sharpening the saw

Alexander Groß agross

🔪
Sharpening the saw
View GitHub Profile
#target indesign
Array.prototype.each = function(fun){
var result = [];
for(var i = 0; i < this.length; i++){
var el = this[i];
var r = fun(el);
if (r) result.push(r);
}
module Helpers
module Items
class Nanoc::Item
# path gibt die "URL" zum Item zurück
old_path = instance_method(:path)
define_method(:path) do |params = { }|
# Für manche Items will ich direkt auf eine andere Seite linken
return @site.items.find!(self[:forward]).path if self[:forward]
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{97BD55A5-03CA-4E8E-8AE0-55722C39E0AF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
@agross
agross / hash_init.rb
Created February 9, 2012 21:53
Trying to initialize a hash with a value from a another, should fail if the other hash doesn't contain the key
hsh = { :key => other_hsh[:foo] or raise "No value for 'foo'!" }
@agross
agross / RequestTypeBehaviorSpecs.cs
Created January 14, 2012 04:04
Specs for a Fubu MVC behavior that controls which HTTP methods are allowed for a controller action
using System;
using System.Net;
using Crimson.Web.Behaviors;
using Crimson.Web.Services;
using FubuMVC.Core.Behaviors;
using Machine.Specifications;
@agross
agross / simyo.rb
Created January 2, 2012 14:56
Simyo invoice downloader
#!/usr/bin/env ruby
USAGE = <<EOF
Usage: simyo.rb <Simyo web login password>
Downloads the latest invoice available on the Simyo web page.
EOF
require 'watir'
require 'rautomation'
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using JetBrains.ReSharper.TaskRunnerFramework;
using Machine.Specifications.ReSharperRunner.Runners.Notifications;
using Machine.Specifications.Runner;
using System;
using System.Linq;
using EasyNetQ;
using StructureMap;
using StructureMap.Query;
namespace Infrastructure
{
@agross
agross / MSpec ordering.cs
Created September 21, 2011 16:13
MSpec ordering
using System.Collections.Generic;
using Machine.Specifications;
namespace ClassLibrary1
{
public class Wenn_ein_Stack_ein_Element_enthält
{
static Stack<int> Stack;
; Make script persistent.
#Persistent
; Recommended for performance and compatibility with future AutoHotkey releases.
#NoEnv
; Recommended for new scripts due to its superior speed and reliability.
SendMode Input
#SingleInstance force
Menu Tray, Tip, Skype Automation
Menu Tray, NoIcon