Skip to content

Instantly share code, notes, and snippets.

View jamesholcomb's full-sized avatar

James Holcomb jamesholcomb

View GitHub Profile
@jamesholcomb
jamesholcomb / xd2md.cs
Created October 13, 2015 19:15 — forked from OldNo7/xd2md.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
namespace Formix.Utils
{
class Program
@jamesholcomb
jamesholcomb / pubsub-kefir.js
Created November 1, 2017 03:08 — forked from antonioaguilar/pubsub-kefir.js
Simple PubSub using KefirJS (version 1)
( function(root, factory) {
root.pubsub = factory(root);
}(this, function() {
var publishEmitter;
var directory;
var eventStream;
var SubscriptionDefinition = function(stream, callback) {
this.stream = stream;
import React, {Component} from "react";
import {Animated, Dimensions, Platform, Text, View} from 'react-native';
import {Body, Header, List, ListItem as Item, ScrollableTab, Tab, Tabs, Title} from "native-base";
const NAVBAR_HEIGHT = 56;
const {width: SCREEN_WIDTH} = Dimensions.get("window");
const COLOR = "rgb(45,181,102)";
const TAB_PROPS = {
tabStyle: {width: SCREEN_WIDTH / 2, backgroundColor: COLOR},
activeTabStyle: {width: SCREEN_WIDTH / 2, backgroundColor: COLOR},
@jamesholcomb
jamesholcomb / kshell
Last active March 13, 2018 21:33 — forked from Stono/kshell
A shell script which enables easy execing into kube pods
#!/bin/sh
if [ "$1" = "" ]; then
echo "Usage: ./ksh <pod>"
exit 1
fi
echo Getting pods...
PODS=$(kubectl get pods --no-headers --output=name | grep $1)
PODS=(${PODS})
NUM_PODS=${#PODS[@]}
@jamesholcomb
jamesholcomb / one_liner.sh
Created October 12, 2022 14:21 — forked from zparnold/one_liner.sh
A simply script to delete all failed pods from Kubernetes
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
@jamesholcomb
jamesholcomb / build-cse-table.py
Created November 7, 2022 13:36 — forked from desrod/build-cse-table.py
Query Zwift public, upcoming events and build an HTML table of those events (in Python)
There are two parts to this:
1. The main Python code that uses requests + json to parse the events
2. The external Jinja2 template that the data is rendered by, producing the HTML output
# ----------------------------------------------------------------------------------------------------------------
#!/usr/bin/env python3
import json
@jamesholcomb
jamesholcomb / Setup MongoDB on localhost as Replica Set
Created April 6, 2023 21:48 — forked from davisford/Setup MongoDB on localhost as Replica Set
Setup MongoDB replica set on local host with only a single primary
Add the `replication` section to the mongod.conf file:
```
$cat /usr/local/etc/mongod.conf
systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
storage:
engine: mmapv1