Skip to content

Instantly share code, notes, and snippets.

View toyflish's full-sized avatar

Kai Rautenberg toyflish

View GitHub Profile
@toyflish
toyflish / apollo.js
Created November 5, 2019 11:54
craftcms preview with nextjs graphql apollo-client
import React from 'react'
import Head from 'next/head'
import { ApolloProvider } from '@apollo/react-hooks'
import { ApolloClient } from 'apollo-client'
import { InMemoryCache, IntrospectionFragmentMatcher } from 'apollo-cache-inmemory'
import { createHttpLink } from 'apollo-link-http';
import { setContext } from 'apollo-link-context';
import fetch from 'isomorphic-unfetch'
import introspectionQueryResultData from '../fragmentTypes.json'
import querystring from 'querystring'
@toyflish
toyflish / initial_cmd.rb
Last active March 9, 2020 16:24
shopify-api console
include ShopifyAPI; ShopifyAPI::Base.api_version = '2020-01'
@toyflish
toyflish / gist:5d5e2f378a086a7a4a1a6523ab2156aa
Created March 7, 2018 16:51
mac zsh docker command completition script install
# the docker docs missing this copy command for the cli completition
curl -L https://raw.githubusercontent.com/docker/cli/c6a7046674293c3004209072cc6b2e08ba2805cb/contrib/completion/zsh/_docker > ~/.zsh/completion/_docker
@toyflish
toyflish / console_stdout_logger.rb
Last active December 3, 2017 12:34
Rails 3 production console log to stdout
Rails.logger = Logger.new(STDOUT)
Rails.logger.level = Logger::DEBUG
@toyflish
toyflish / wp-selectagram.php
Last active August 29, 2015 14:15
Consume Selectagram feed
<?php
/*
Plugin Name: WP Selectagram
Plugin URI:
Description: Selectagram on wp
Version: 1.0
Author: Kai Rautenberg
Author URI: http://www.selectagram.com
License: GPL2
*/
@toyflish
toyflish / enviroment.rb
Created April 19, 2010 17:25
rails 2.3.5, Activerecord-sessionstore takes session-id from get-vars if passed by shockwave flash (uploadify) using rack-middleware
# part of config/enviroment.rb
...
Rails::Initializer.run do |config|
# Load model files from sub folders
config.load_paths += Dir["#{RAILS_ROOT}/app/models/*"].find_all { |f| File.stat(f).directory? }
# Load middleware - initially used by flash-session-hack
config.load_paths << "#{RAILS_ROOT}/app/middleware"