Skip to content

Instantly share code, notes, and snippets.

@KazW
KazW / cardano-db-sync.yml
Created May 23, 2021 08:35
Run a Cardano Node with DB Syncing to Postgres
apiVersion: v1
data:
db-sync-config.json: |
{
"EnableLogMetrics": false,
"EnableLogging": true,
"NetworkName": "mainnet",
"NodeConfigFile": "/nix/store/9qxnjirql2snfln1w2gwdl8169l7404x-config-mainnet.json",
"RequiresNetworkMagic": "RequiresNoMagic",
"defaultBackends": [
@KazW
KazW / apollo-config.js
Last active January 29, 2022 14:12
Hasura, Nuxt (Vue), Nuxt Auth, Auth0 and Apollo
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 August 29, 2015 14:07
2.1.3 method declaration syntax
# 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 December 22, 2015 14:58
GNU licenses formatted in Markdown.

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.

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 December 16, 2015 09:48
Discourse God file, needs work.
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 August 15, 2012 21:56
GooseBerry Boot Up
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 09:19 — forked from aaronshaf/es.sh
Install ElasticSearch on Ubuntu 11.04
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 October 3, 2015 07:58
CentOS rbenv install for each user. (if they clone it)
# 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