Skip to content

Instantly share code, notes, and snippets.

View emwalker's full-sized avatar

Eric Walker emwalker

  • Bold Penguin
  • Loveland, Colorado
View GitHub Profile
@emwalker
emwalker / nom_selector.rs
Last active November 29, 2023 02:21
Nom parser for CSS3 tokens
use super::{ast::Node, new_tokenizer::Token};
use nom::{
branch::alt, bytes::complete::tag, combinator::map, sequence::tuple, Compare, IResult,
InputIter, InputLength, InputTake,
};
impl InputLength for Token {
fn input_len(&self) -> usize {
1
}
---
kind: Service
apiVersion: v1
metadata:
name: frontend
spec:
selector:
app: appname
tier: frontend
ports:
openssl genrsa -out $username.key 4096
openssl req -new -key $username.key -out $username-csr.pem -subj "/CN=$username" -days 365
echo "Creating a certificate signing request for $username"
cat <<EOF | kubectl create -f -
apiVersion: certificates.k8s.io/v1beta1
kind: CertificateSigningRequest
metadata:
name: $username
spec:
@emwalker
emwalker / setup.md
Last active February 27, 2021 07:06
Geting set up with Cayley and Postgres (April 2018)

Getting set up with Cayley and Postgres (April 2018)

Initialize the database

$ createdb testdb
$ wget https://github.com/cayleygraph/cayley/releases/download/v0.7.2/cayley_0.7.2_darwin_amd64.tar.gz
$ tar zxvf cayley_0.7.2_darwin_amd64.tar.gz
$ cat >cayley.cfg.json
{
  "store": {
@emwalker
emwalker / summary
Created February 26, 2018 14:15
Failing k8s tests
--- FAIL: TestExampleObjectSchemas (0.16s)
examples_test.go:379: Directory ../examples/elasticsearch: Expected 3 examples, Got 0
examples_test.go:352: skipping : ../examples/openshift-origin/secret.json/secret
FAIL
FAIL k8s.io/kubernetes/examples 0.217s
--- FAIL: Example_printPodHideTerminated (0.00s)
got:
NAME READY STATUS RESTARTS AGE
test1 1/2 Pending 6 10y
@emwalker
emwalker / On a Mac, in Docker:
Created February 25, 2018 19:48
Running the Kubernetes unit tests
This file has been truncated, but you can view the full file.
$ build/run.sh make test > make-test-docker.log 2>&1 ; echo $? (eu-production/production)
1
$ cat make-test-docker.log
+++ [0225 12:28:20] Verifying Prerequisites....
+++ [0225 12:28:21] Using Docker for MacOS
+++ [0225 12:28:22] Building Docker image kube-build:build-bcacb243b9-5-v1.9.3-2
+++ [0225 12:28:25] Keeping container kube-build-bcacb243b9-5-v1.9.3-2
+++ [0225 12:28:25] Keeping container kube-build-data-bcacb243b9-5-v1.9.3-2
+++ [0225 12:28:25] Keeping container glassfrog_rails_1
+++ [0225 12:28:25] Keeping container xenodochial_leakey
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: backup-production-database
spec:
schedule: "*/30 * * * *"
jobTemplate:
spec:
template:
@emwalker
emwalker / nesting.patch
Created November 16, 2017 20:29
Allow nested queries
commit 39203ff494701c0445cec1139dbebf981c0b5a38
Author: Eric Walker <eric.walker@holacracyone.com>
Date: Thu Nov 16 15:10:08 2017 -0500
Add GraphQL::Batch::Executor.setup, .teardown.
diff --git a/lib/graphql/batch.rb b/lib/graphql/batch.rb
index 89b7359..ee70f75 100644
--- a/lib/graphql/batch.rb
+++ b/lib/graphql/batch.rb
@emwalker
emwalker / nested.patch
Created November 14, 2017 19:02
Allow nested execution
commit ca10b17221be21f6ec71138da25059a5611e3eb9
Author: Eric Walker <eric.walker@holacracyone.com>
Date: Tue Nov 14 13:54:08 2017 -0500
Allow nested execution.
diff --git a/lib/graphql/batch.rb b/lib/graphql/batch.rb
index 89b7359..2a3118d 100644
--- a/lib/graphql/batch.rb
+++ b/lib/graphql/batch.rb
@emwalker
emwalker / .rubocop.yml
Last active September 12, 2017 20:43
Rubocop rules for block braces
# Space between `method_name` and `{`
# https://rubocop.readthedocs.io/en/latest/cops_layout/#layoutspacebeforeblockbraces
Layout/SpaceBeforeBlockBraces:
EnforcedStyle: space
Exclude:
- 'app/queries/*'
# Space after block `{` and space before `}`
# https://rubocop.readthedocs.io/en/latest/cops_layout/#layoutspacebeforeblockbraces
Layout/SpaceInsideBlockBraces: