Skip to content

Instantly share code, notes, and snippets.

var vertices = [];
var edges = [];
vertices.push("A");
vertices.push("B");
vertices.push("C");
vertices.push("D");
vertices.push("E");
edges.push(["A", "B"]);
@jmcguirk
jmcguirk / currval.cs
Created December 23, 2013 23:08
Curr Value formula
/// <summary>
/// Gets the current max attack defensive power for this unit.
/// </summary>
/// <value>
/// The current max hitpoints.
/// </value>
public int CurrentMagic {
get {
int res = this.BaseMagic + (int)(((double)(this.CurrentMaxMagic - this.BaseMagic) / (double)this.GrowthCurve.Values[MaxLevel]) * GrowthModifier);
@jmcguirk
jmcguirk / request-context.js
Created December 19, 2013 22:33
Request Context class
/*!
* Wraps a bunch of stuff within the current request
*/
function RequestContextClass(){
this.ClientIp;
this.GeoIpData;
this.Request;
this.Response;
this.RequestStartTime;
{
"name": "e_gear_worn_ring_health_1",
"inherits": "e_gear_base",
"components": {
"Gear": {
"Rarity": 10,
"Icon": "icon_gear_worn_ring_health_1",
"Requirements": {
"Equip": [
{
@jmcguirk
jmcguirk / e_gear_worn_ring_health.json
Created December 18, 2013 16:12
Gear schema draft
{
"name": "e_gear_worn_ring_health_1",
"inherits": "e_gear_base",
"components": {
"Gear": {
"Rarity": 10,
"Icon": "icon_gear_worn_ring_health_1",
"Requirements": {
"Equip": [
{
{
"name": "e_gear_worn_ring_health_1",
"inherits": "e_gear_base",
"components": {
"Gear": {
"Rarity": 10,
"Icon": "icon_gear_worn_ring_health_1",
"Requirements": {
"Equip": [
{
@jmcguirk
jmcguirk / app.sh
Created December 13, 2013 21:35
init.d script for node js cluster server
#!/bin/sh
#
# chkconfig: 35 99 99
# description: Node.js /home/nodejs/sample/app.js
#
. /etc/rc.d/init.d/functions
USER="root"
@jmcguirk
jmcguirk / gist:7951743
Created December 13, 2013 21:34
node js clustered app start/stop init.d script
#!/bin/sh
#
# chkconfig: 35 99 99
# description: Node.js /home/nodejs/sample/app.js
#
. /etc/rc.d/init.d/functions
USER="root"
@jmcguirk
jmcguirk / repair_missing_commander.js
Created November 15, 2013 21:48
Node Crawler Script
//** DANGER **/
/* DO NOT RUN THIS SCRIPT UNLESS YOU KNOW WHAT YOU ARE DOING! */
//** DANGER **/
var redis = require("redis");
var stacks = [{
@jmcguirk
jmcguirk / snippet.js
Created November 13, 2013 17:00
Service Tier Snippet
this.exchangeCurrency = function(args, context, callback){
var callResponse = {};
var targetCurrency = args.targetCurrency;
var targetCurrencyAmount = args.targetCurrencyAmount;
if(targetCurrency != null){
if(targetCurrencyAmount > 0){
ServiceLocator.PlayerManager.getOrCreatePlayer(context.UserId, context, function(player){
var currencyTemplate = ServiceLocator.EntityTemplateManager.getTemplateByName(targetCurrency);
if(currencyTemplate != null){
var currencyConfig = currencyTemplate.components.Resource;