Skip to content

Instantly share code, notes, and snippets.

@sax1johno
sax1johno / machine.js
Last active June 21, 2022 15:03
Generated by XState Viz: https://xstate.js.org/viz
const betMachine = Machine(
{
"id": "StandardBet",
"initial": "waitingForPlayerAction",
"bettingOrder": [
"c",
"d",
"e",
"f",
"g",
Contract:
{ parameter (or (or nat nat) (pair nat address)) ;
storage (pair (pair (map nat (pair mutez nat)) (map nat (pair address nat))) nat) ;
code { {} ;
{ { {} ;
{ {} ;
PUSH (lambda
(pair (pair nat address)
(pair (pair (map nat (pair mutez nat)) (map nat (pair address nat))) nat))
(pair (list operation)
@sax1johno
sax1johno / KubernetesNamespaceForceFinalize.txt
Last active August 30, 2018 16:56
Fix for Kubernetes Namespace being stuck in the "Terminating" state
# Sometimes, when you attempt to delete a namespace in kubernetes, it can get stuck in the "terminating" state.
# This generally happens when there are resources still assigned to that namespace when it is deleted.
# The finalizers are unable to confirm that all resources are cleared out, so they fail and stay locked in the "terminating" state.
# You can fix it by doing the following:
# First, proxy the kubernetes api cluster to your local system
$ kubectl serve
# find each namespace impacted
$ kubect get namespace <ns> -o json > temp.json
docker run -d --restart=unless-stopped -p 8080:8080 -p 9345:9345 rancher/server \
--db-host <hostName> --db-port 3306 --db-user <username> --db-pass <password> --db-name rancher_cattle \
--advertise-address awslocal
/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:robert@broofa.com
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*
<html>
<head>
</head>
<body>
<div ng-controller="PageController">
<button value="Click to open modal" ng-click="openModal" />
</div>
<script type="text/template" id="myModalTemplate.html">
<h1>This is my modal popup template</h1>
<input type="text" ng-model="user.username" />
master:
image: rancher/server
container_name: master
volumes_from:
- mysql
ports:
- "8080:8080"
links:
- mysql
environment:
@sax1johno
sax1johno / SearchAndSort_main.cpp
Created April 27, 2017 00:16
Binary Search, Linear Search, and Bubble Sort implementations from 04/26/2017
#include <vector>
#include <iostream>
int linearSearch(std::vector<int> &vectorToSearch, int itemToTest);
void bubbleSort(std::vector<int> &vectorToSort);
int binarySearch(std::vector<int> &vectorToSearch, int numToTest);
int main() {
std::vector<int> myVector;
myVector.push_back(5);
## RESTHeart Configuration File.
---
#### Listeners
# Listeners allow to specify the protocol, ip, port and to use.
# The supported protocols are: http, https and ajp. You can setup a listener per protocol (up to 3).
# WARNING: RESTHeart uses basic authentication; usernames and passwords are sent over the net on each request.
# Using the http listener is not secure: users credentials can be sniffed by a man-in-the-middle attack.
# Use the http listener only on trusted environments.
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}