Skip to content

Instantly share code, notes, and snippets.

View openerror's full-sized avatar

Ev L openerror

View GitHub Profile
@openerror
openerror / do_while_sample.py
Last active July 1, 2019 03:44
Sample do-while loop in Tensorflow
from math import fabs
import tensorflow as tf
def test_func_tf(x):
x = tf.math.abs(x)
# Callables used for tf.cond(), which replicates the if statement
def continue_loop(): return tf.while_loop(cond, body, loop_vars=[x], return_same_structure=True)
def exit_loop(): return x
@openerror
openerror / index.js
Created April 30, 2018 20:12
SkygearStripe Demo-APIEndPt
const SKYGEAR_ENDPOINT = '<Your Endpoint Here>';
const SKYGEAR_API_KEY = '<Your API Key Here>';
skygear.config({
'endPoint': SKYGEAR_ENDPOINT, // Endpoint
'apiKey': SKYGEAR_API_KEY, // API Key
}).then(() => {
console.log('Skygear container is now ready for making API calls.');
}, (error) => {
console.error(error);
@openerror
openerror / index.html
Last active April 30, 2018 20:08
SkygearStripe Demo-CDNs
<html>
<head>
<title>Skygear + Stripe demo</title>
<!--Skygear CDN-->
<script src="https://code.skygear.io/js/polyfill/latest/polyfill.min.js"></script>
<script src="https://code.skygear.io/js/skygear/latest/skygear.min.js"></script>
<!-- OG metadata -->
<meta property="og:title" content="Skygear + Stripe demo" />
<meta property="og:description" content="Skygear Cloud Function to send form data to emails from static website" />
<meta property="og:type" content="website" />