Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
## Conventions:
##
## Working directory has the same name as the s3 bucket.
## Script is executed from the parent of this directory.
##
BUCKET=$1
@bluejack
bluejack / array-of-arrays.js
Last active November 12, 2018 17:37
Javascript array of arrays for Ian Brown
var ballots[]
onEvent("submitBtn", "click", function(){
var newBallot = [getNumber("rank1"), getNumber("rank2"), getNumber("rank3"), getNumber("rank4"), getNumber("rank5")]
ballots.push(newBallot)
console.log (newBallot)
console.log ("We now have " + ballots.length + " in our system!"
});
// Here's a little sample to show how you might begin to tabulate the ballots...
function tabulateBallots() {
@bluejack
bluejack / list-item-nested-components.js
Last active November 11, 2018 07:27
Vue Nested List and Item Component
<DOCTYPE html>
<html>
<head>
<title>Test Vue List</title>
<meta charset='utf-8'>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vuex"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
@bluejack
bluejack / list-item-component.js
Created November 11, 2018 05:02
Vue component for items in a list
Vue.component('event-list-item', {
template: "<h4>{{ item.title }}</h4>",
props: {
ikey: {
type: String,
required: true
}
},
data: function() {
return {
/*
* This is only going to show a list of the keys themselves.
*
* Expected output:
* - key1
* - key2
* - key3
*/
Vue.component('event-list', {
template: "<div><ul><li v-for='key in list'>{{ key }}</li></div>",
@bluejack
bluejack / vuex-state.js
Created November 11, 2018 02:29
A sample state model for a Vuex store
state: {
list: ['key1', 'key2', 'key3'],
items: {
key1: { title: "Title 1"},
key2: { title: "Title 2"},
key3: { title: "Title 3"}
}
}