Skip to content

Instantly share code, notes, and snippets.

Rob rm-rf-etc

  • San Francisco
Block or report user

Report or block rm-rf-etc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rm-rf-etc
rm-rf-etc / omit.js
Last active Dec 26, 2019
Removes the `_` property from every level of a nest gun.js data node.
View omit.js
import omit from "lodash.omit";
import keys from "lodash.keys";
export default (ref1) => {
if (typeof ref1 !== "object") return ref1;
function stripProp(prop, ref2) {
if (typeof ref2[prop] !== "object") return;
/* eslint-disable-next-line no-param-reassign */
ref2[prop] = omit(ref2[prop], "_");
@rm-rf-etc
rm-rf-etc / includes.js
Last active Dec 26, 2019
Basics of using ES Modules
View includes.js
export const add = (a, b) => a + b;
export const subtract = (a, b) => a - b;
export default { add, subtract };
@rm-rf-etc
rm-rf-etc / do_query.js
Last active Oct 24, 2019
Cayley Graph Database Example - Get user with friends
View do_query.js
function predicatesToList(thingId) {
var thing = g.V(thingId);
var result = [];
thing.outPredicates().map(function(a){
if (!a) return;
thing.out(a.id).map(function(b){
result.push([a.id, b.id]);
});
@rm-rf-etc
rm-rf-etc / The_Thunk_Emperor_Has_No_Clothes.js
Last active Jul 11, 2019
The Thunk Emperor Has No Clothes
View The_Thunk_Emperor_Has_No_Clothes.js
/******************************\
The Thunk Emperor Has No Clothes
\******************************/
/* ACT ONE
myAction:
"I'm an action creator!"
View kubectl-connect.sh
#!/bin/bash
###################
## SAMPLE OUTPUT ##
###################
: <<'END'
Press Ctrl-C to exit at any point
Please enter a name for this cluster: prod1
@rm-rf-etc
rm-rf-etc / arango-init.sh
Created Aug 8, 2018
Install the ArangoDB Operator into a Kubernetes cluster
View arango-init.sh
#!/bin/bash
# Installs the ArangoDB Operator into a Kubernetes cluster
LOCAL_STORAGE_YAML="\
apiVersion: storage.arangodb.com/v1alpha
kind: ArangoLocalStorage
metadata:
name: example-arangodb-storage
spec:
storageClass:
@rm-rf-etc
rm-rf-etc / index.html
Last active Apr 22, 2018
SVG sine wave
View index.html
<!DOCTYPE html>
<html>
<head>
<style>
html, body { width: 100%; height: 100%; margin: 0; padding: 0; }
body { position: relative; }
div { position: relative; margin: auto; width: fit-content; margin-top: calc(50vh - 200px); }
</style>
</head>
<body>
You can’t perform that action at this time.