Skip to content

Instantly share code, notes, and snippets.

View jwulf's full-sized avatar
:octocat:
Coding on Halmak

Josh Wulf jwulf

:octocat:
Coding on Halmak
View GitHub Profile
sitapati@MacBook-Air [~/workspace/BGL-JAWS/jaws-bgl/aws_modules] $ jaws help create lambda
jaws create lambda
Options:
--endpoint, -e [string] Create an API Gateway endpoint for this AWSM Lambda
--name [string] Name for the newly created resource
--package-manager, -p [string] Specify a package manager to scaffold for publishing this AWSM Lambda
--runtime, -R [string] Runtime for this AWSM Lambda. Defaults to nodejs
/**
* AWS Module: Action: Modularized Code with Promise for Asynchronous functions
*/
var Promise = require('bluebird');
// Export For Lambda Handler
module.exports.run = function(event, context, cb) {
return action(event).then(function(result) {
cb(null, result);
/**
* AWS Module: Action: Modularized Code with Promise for Asynchronous functions
*/
var Promise = require('bluebird');
// Export For Lambda Handler
module.exports.run = function(event, context, cb) {
'use strict';
/**
* AWS Module: Action: Lambda Handler
* "Your lambda functions should be a thin wrapper around your own separate
* modules, to keep your code testable, reusable and AWS independent"
*/
require('jaws-core-js/env');
@jwulf
jwulf / worlds.yml
Created September 5, 2016 00:28
Worlds.yml file
worlds:
kigam:
==: MVWorld
hidden: 'false'
alias: ''
color: WHITE
style: NORMAL
pvp: 'true'
scale: '1.0'
respawnWorld: ''
#!/usr/bin/env jjs
/*####################################################################################################################################
# As Nashorn does not have http capabilities through XMLHttpRequest (DOM API), we have to use regular Java classes instead.
# This sample shows how this can be acheived without depending on any third party libraries. Just a standard Java 8 JDK.
# Make sure to have JAVA_HOME/bin on your PATH for the shebang to work. Then just chmod +x away and run...
# Alternatively if you're on a non *nix OS, start with jjs -scritping httpsample.js
####################################################################################################################################*/
var url = "https://api.github.com/users/billybong/repos";
var response;
{
"stats": {
"totalNumberOfWizards": 9,
"mostUsedSpell": "dixit",
"totalNumberOfSpellsCast": 5093,
"spellUsageBreakdown": [
{
"spellName": "dixit",
"count": 14
},
@jwulf
jwulf / gist:bc7a5f66d4a5294b453ec833046b3034
Created February 18, 2017 02:40
MCT1 Metabolic Cycle Prototype
In the event loop, each cycle do this:
class Player {
const carbsAbsorptionRate; // how many carbs are absorbed per cycle
const insulinAbsorptionRate; // how many units of insulin are absorbed per cycle
const carbsPerInsulinUnit; // how many grams of carbs are metabolise per insulin unit
const carbsToHealthMagicNumber; // how many carbs convert to 1 unit of player health when metabolised
const carbsToBGLMagicNumber; // how many carbs convert to one point of BGL when unmetabolised
const BGLCorrectionPerInsulinUnitMagicNumber; // how many BGL points drop per one unit of insulin without carbs
carbsOnBoard; // current carbs onboard
const fs = require('fs');
const package = JSON.parse(fs.readFileSync('./package.json'));
//console.log(package);
const deps = package.dependencies;
console.log(deps);
for (let i = 0; i < Object.keys(deps).length; i++) {
const magik = magikcraft.io;
let T1, Java;
const BossBarAPI = Java.type("org.inventivetalent.bossbar.BossBarAPI");
function t1() {
var TextComponent = Java.type("net.md_5.bungee.api.chat.TextComponent");
T1 = {
state:
{