Skip to content

Instantly share code, notes, and snippets.

View robertz's full-sized avatar

Robert Zehnder robertz

View GitHub Profile
export default {
data () {
return {
offset: 0,
tz: 'America/New_York',
}
},
computed: {
payees () { // may be referenced as this.payees
return this.$store.state.payees;
import { mapState } from 'vuex'
import mobData from '../5e-SRD-Monsters.json'
import gameData from '../gameData.json'
export default {
name: 'combat',
data () {
return {
mobs: mobData.filter((mob) => { return ('name' in mob) }),
alive: true,
#!/bin/bash
script='csvinator.sh'
# There date param and country should always be passed in
if [ $# -lt 2 ];
then
echo Usage ${script} rundate country
exit 1;
fi
@robertz
robertz / create.php
Created April 29, 2019 21:06
Easily create user account
<html lang="en">
<head>
<meta charset="utf-8">
<title>Create Account</title>
<meta name="description" content="Create Account">
<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="//code.jquery.com/jquery-3.4.0.min.js"></script>
</head>
@robertz
robertz / create.php
Created April 30, 2019 12:28
Sets up a user game account on a score server
<html lang="en">
<head>
<meta charset="utf-8">
<title>score</title>
<meta name="description" content="Score Server">
<meta name="author" content="score">
<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="//code.jquery.com/jquery-3.4.0.min.js"></script>
param([string] $userName = "coh",
[string] $userPassword = "coh")
$ErrorActionPreference = "STOP"
function Get-Adler32 {
param(
[string] $data
)
component output = "false" {
public function init() {
variables['instance'] = {};
instance['hasExecuted'] = false;
instance['isJson'] = "";
instance['created'] = now();
instance['url'] = "";
instance['resolvedUrl'] = "";
instance['verb'] = "GET";
@robertz
robertz / example1.cfm
Last active July 10, 2019 00:17
example httpRequest file
<cfscript>
baseUrl = "https://jsonplaceholder.typicode.com";
api = new API();
api
.setUrl( baseUrl & '/posts')
.execute();
writeDump(api.getResult());
[
{
"userId": 1,
"id": 1,
"title": "I rewrote the title",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
},
{
"userId": 1,
"id": 2,
<cffunction name="xmlToStruct" access="public" returntype="struct" output="false">
<cfargument name="xmlNode" type="string" required="true" />
<cfscript>
var res = {};
var xmlDoc = xmlSearch(xmlParse(xmlNode), "/node()")[1];
for(var i = 1; i <= xmlDoc.xmlChildren.len(); i++){
var n = replace(xmlDoc.XmlChildren[i].XmlName, xmlDoc.XmlChildren[i].XmlNsPrefix & ":", "");
if(res.keyExists(n)){
if(!isArray(res[n])){
tmp = res[n];