Skip to content

Instantly share code, notes, and snippets.

Avatar

Kaz Walker KazW

View GitHub Profile
@KazW
KazW / apollo-config.js
Last active Nov 8, 2020
Hasura, Nuxt (Vue), Nuxt Auth, Auth0 and Apollo
View apollo-config.js
import { SubscriptionClient } from 'subscriptions-transport-ws'
import { onError } from 'apollo-link-error'
import { setContext } from 'apollo-link-context'
import { split, from } from 'apollo-link'
import { WebSocketLink } from 'apollo-link-ws'
import { getMainDefinition } from 'apollo-utilities'
import { createUploadLink } from 'apollo-upload-client'
import * as ws from 'ws'
export default (context) => {
@KazW
KazW / example.rb
Last active Aug 29, 2015
2.1.3 method declaration syntax
View example.rb
# All of the following method declarations are equivalent. (They all have the same result)
# The only difference is in how they are called.
some_data = {required_argument: 'bob', optional_argument: 'dole'}
# Pre 2.1.3 style
def some_method(required_argument, optional_requirement = nil)
p [required_argument, optional_argument]
end
@KazW
KazW / AGPL.md
Last active Dec 22, 2015
GNU licenses formatted in Markdown.
View AGPL.md

GNU AFFERO GENERAL PUBLIC LICENSE

Version 3, 19 November 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

View db_store.rb
require 'openid/store/interface'
module OpenID::Store
class Association
include Mongoid::Document
field :secret, :type => Binary
def from_record
OpenID::Association.new(handle, secret.to_s, issued, lifetime, assoc_type)
end
@KazW
KazW / discourse.god
Last active Dec 16, 2015
Discourse God file, needs work.
View discourse.god
rails_env = 'production'
rails_root = File.dirname(File.dirname(__FILE__)) # Place this file in the config directory
secret_token = 'CHANGE_THIS'
user = 'deployer'
group = 'users'
num_webs = 4
environment = {'RAILS_ENV' => rails_env, 'SECRET_TOKEN' => secret_token, 'RUBY_GC_MALLOC_LIMIT' => 90000000}
config_hash = {:rails_root => rails_root, :user => user, :group => group, :environment => environment}
@KazW
KazW / gist:3364042
Created Aug 15, 2012
GooseBerry Boot Up
View gist:3364042
U-Boot SPL 2011.09 (Aug 14 2012 - 04:00:32)
MMC: SUNXI SD/MMC: 0
Loading U-Boot... OK!
Jumping to U-Boot...
U-Boot 2011.09 (Aug 14 2012 - 04:00:32) Allwinner Technology
CPU: SUNXI Family
Board: A10-EVB
@KazW
KazW / es.sh
Created May 15, 2012 — forked from aaronshaf/es.sh
Install ElasticSearch on Ubuntu 11.04
View es.sh
cd ~
sudo apt-get update
sudo apt-get install unzip curl python-software-properties -y
wget https://raw.github.com/flexiondotorg/oab-java6/master/oab-java6.sh -O oab-java6.sh
chmod +x oab-java6.sh
sudo ./oab-java6.sh
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.7.tar.gz -O elasticsearch.tar.gz
@KazW
KazW / .gemrc
Last active Oct 3, 2015
CentOS rbenv install for each user. (if they clone it)
View .gemrc
# Consider putting this file in /etc/skel
# Avoid installing rdoc and ri by default
:update_sources: true
:sources:
- https://rubygems.org
:benchmark: false
:bulk_threshold: 1000
:backtrace: false
:verbose: true
gem: --no-ri --no-rdoc
You can’t perform that action at this time.