Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css">
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>
<h1>Standard</h1>
<form id="foo">
<input type="radio" name="bar" value="1" /> 1
#! /bin/bash
if [ -z "$1" ]
then
echo "First argument is a path to the OpenCV source repo cloned from github";
fi
if [ -z "$2" ]
then
echo "Second path is where you want the venv to end up";
import argparse
GLOBAL_X = None
def dialog_fn():
return GLOBAL_X
def matlab_ported_fn():
print(dialog_fn())
@brianthelion
brianthelion / test_numpy_vs_matlab.py
Last active August 1, 2016 14:08
nose testing examples for numpy/matlab unit regressions
import matlab
from Zhang_Suen_ported.py import Zhang_Suen
TEST_LIST = [
('Zhang_Suen.m', Zhang_Suen, (fin2, )),
]
def call_matlab(ml_func_name, args):
NotImplementedError("Do some magic here")
@brianthelion
brianthelion / rt_insert.py
Last active August 8, 2016 16:31
Decorators for numpy-to-matlab regression automation
import decorator
class RuntimeInsertionManager(object):
def insert_with_args(self, *args, **dargs):
@decorator.decorator
def _wrapper(wrapped, *_args, **_dargs):
if hasattr(self, 'callback'):
return self.callback(wrapped, _args, _dargs, args, dargs)
return wrapped(*_args, **_dargs)
return _wrapper
@brianthelion
brianthelion / childrenRect_bug.qml
Created December 17, 2016 14:53
Strange behavior with childrenRect in which the onChildrenRectChanged signal doesn't always fire.
import QtQuick 2.5
import QtQuick.Controls 1.4
Item {
width: 800
height: 600
property string src: "import QtQuick 2.5; Rectangle{ width: 50; height: 50; color: \"red\"}"
Item {
id: a_container
@brianthelion
brianthelion / test_provisioning.sh
Created August 18, 2017 19:17
Salt cluster bootstrapping recipe
CONFIG_DIR=$(mktemp -d)
FILE_ROOT=$(mktemp -d)
ROOT_DIR=$(mktemp -d)
cat <<EOF > $CONFIG_DIR/master
root_dir: $ROOT_DIR
file_roots:
base:
- $FILE_ROOT
EOF
@brianthelion
brianthelion / test_constraints.sh
Last active February 17, 2019 13:44
Example of using constraints.txt with local dependencies in "editable" mode
#! /bin/bash
set -e
random-string() {
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w ${1:-32} | head -n 1
}
BASENAME=$(basename "$0")
TMP_DIR=$(mktemp -d -t ${BASENAME}-XXXXX)
@brianthelion
brianthelion / README.md
Last active October 28, 2020 21:44 — forked from wheresjames/README.md
Publishing a static HTML site on GCP, including SSL

Note

This gist is a fork. I found OP's gsite.sh code below informative, but ultimately didn't use it. See my steps.sh.

Links

@brianthelion
brianthelion / kind-multus.sh
Last active December 23, 2021 02:08
Complete example of how to run multus on kind with limited shenanigans
set -ex
RND=$(openssl rand -hex 12)
NET=net-${RND}
IFACE=if-${RND}
CLUSTER=cl-${RND}
TMP=$(mktemp -d)
CFG=${TMP}/config.yaml
LOG=${TMP}/log
POD=${TMP}/pod