Skip to content

Instantly share code, notes, and snippets.

@kbredemeier
kbredemeier / network-interface.js
Last active June 28, 2017 10:39
NetworkInterface for apollo-client and absinthe_plug to handle file uploads
import { HTTPFetchNetworkInterface, printAST } from 'apollo-client'
require('isomorphic-fetch')
/*
* Traverses the node recursively and searches for File or FileList
* occurences and replaces theire values with the path to the value inside
* the node. It returns an object mapping the paths to theire File/FileList.
*/
function recurse(node, path = []) {
@kbredemeier
kbredemeier / bootstrap_topbar_list.rb
Created February 15, 2012 14:42 — forked from tmaier/bootstrap_topbar_list.rb
BootstrapTopbarList for simple-navigation and Twitter Bootstrap integration
# Renders an ItemContainer as a <ul> element and its containing items as <li> elements.
# Prepared to use inside the topbar of Twitter Bootstrap http://twitter.github.com/bootstrap/#navigation
#
# Register the renderer and use following code in your view:
# render_navigation(level: 1..2, renderer: :bootstrap_topbar_list, expand_all: true)
class BootstrapTopbarList < SimpleNavigation::Renderer::Base
def render(item_container)
if options[:is_subnavigation]
ul_class = "dropdown-menu"
@kbredemeier
kbredemeier / activity.java
Created December 19, 2011 00:48
se1 uebung 9
public class Activity extends ActivityComponent {
private int time;
public Activity(int t) {
this.time = t;
}
public int count() {
return time;
}
@kbredemeier
kbredemeier / env.rb
Created November 23, 2011 14:34
Cucumber enviroment
require 'rubygems'
require 'spork'
Spork.prefork do
require 'cucumber/rails'
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'rspec/rails'
require 'capybara/rails'
Capybara.default_selector = :css
Capybara.default_driver = :webkit