Skip to content

Instantly share code, notes, and snippets.

@nickstenning
nickstenning / job.yaml
Created April 30, 2024 18:06
Running migrations in k8s
apiVersion: batch/v1
kind: Job
metadata:
name: testjob
spec:
# Never retry this job.
backoffLimit: 0
template:
spec:
containers:
build:
gpu: false
python_version: "3.11"
predict: "predict.py:Predictor"
package main
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"log"
"net/http"
package main
import (
"context"
"fmt"
"io"
"log"
"net/http"
"net/http/httptrace"
"time"
@nickstenning
nickstenning / bpnn.py
Created March 26, 2011 01:29
Back-propagation neural networking in python
# Back-Propagation Neural Networks
#
# Written in Python. See http://www.python.org/
# Placed in the public domain.
# Neil Schemenauer <nas@arctrix.com>
import math
import random
import string
import argparse
import math
import textwrap
from datetime import timedelta
DURATIONS = {"s": 1, "m": 60, "h": 3600, "d": 86400, "w": 604800}
ERROR_RATES = [
0.0001,
0.0005,
0.001,
@nickstenning
nickstenning / README.md
Created March 16, 2020 15:48 — forked from notheotherben/README.md
COVID-19 F@H AzureVM Template

COVID-19 F@H Azure VM Template

Deploy an Azure VM to help Folding@Home

This is an Azure VM template which deploys a GPU-enabled VM of your choice to help the Folding@Home project find ways to combat COVID-19.

@nickstenning
nickstenning / docker.sh
Created July 28, 2014 12:36
Docker cleanup aliases
alias dockercleancontainers="docker ps -a --no-trunc | grep 'Exit' | awk '{print $1}' | xargs docker rm"
alias dockercleanimages="docker images --no-trunc | grep none | awk '{print $3}' | xargs docker rmi"
alias dockerclean="dockercleancontainers && dockercleanimages"
import React from "react";
import PropTypes from "prop-types";
import { compose } from "redux";
import { connect } from "react-redux";
import { isEmpty, populate, withFirebase } from "react-redux-firebase";
import AppDrawerAuth from "./AppDrawerAuth";
class AppDrawerAuthContainer extends React.Component {
render() {
const { profile, signOut } = this.props;
def responds_to?(method_name)
->(obj) { obj.respond_to?(method_name) }
end
[
1,
"string",
%w{an array},
{a: 'hash'}
].each do |object|