This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<label for="strQuery">Enter a string:</label> | |
<input type="text" id="strQuery"> | |
<button type="submit" id="submit">Submit</button> | |
<p id="result"></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
text-align: justify; | |
} | |
code, pre { | |
font-family: "DejaVuSansMono", monospace; | |
} | |
h1, h2, h3, h4, h5, h6 { | |
text-align: left; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import random | |
def lambda_handler(event, context): | |
""" Build a random cold-cut sandwich """ | |
meats = [ | |
'ham', 'salami', 'turkey', 'chicken', 'meatball', 'tempeh' | |
] | |
cheeses = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<script> | |
async function fetchSandwich() { | |
let apiUrl = 'https://***.execute-api.us-east-2.amazonaws.com/default/lambda_tutorial' | |
let response = await fetch(apiUrl); | |
let body = await response.json(); | |
document.getElementById('sandwich-result').innerHTML = body.sandwich; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def analyze_audit_history(self): | |
""" Parse audit history response and separate out deletes vs modifications/creations """ | |
last_modified_by_type, modified_ids, deleted_ids = {}, set(), set() | |
last_modified_by_type['glbatch'] = arrow.now() # Always consider glbatches modified | |
for audit_trail in self._get_audit_trail(): | |
for event in audit_trail.response.data.find_all('audithistory'): | |
object_type = event.objecttype.get_text() | |
# Consolidate journal and glbatch to be the same, since they hit the same endpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import App from './App.vue' | |
Vue.config.productionTip = false | |
new Vue({ | |
render: h => h(App), | |
}).$mount('#app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head></head> | |
<body> | |
<h1>Testing Vue...</h1> | |
<div id="app"></div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.shortcuts import render | |
def vue_test(request): | |
return render(request, 'myapp/vue-test.html') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from django.urls import path | |
from myapp import views as myapp_views | |
urlpatterns = [ | |
path('admin/', admin.site.urls), | |
path('vue-test', myapp_views.vue_test), | |
] |
OlderNewer