Skip to content

Instantly share code, notes, and snippets.

View jaypeeZero's full-sized avatar

James Wright jaypeeZero

  • St. Louis
  • 13:46 (UTC -05:00)
View GitHub Profile
@jaypeeZero
jaypeeZero / Wargames.prompt.md
Created April 19, 2025 16:23
SHALL WE PLAY A GAME?

#WarGames Simulation Prompt

WarGames Simulation Overview

Objective: Create a dynamic Cold War simulation where the player (Professor Falken) navigates global conflicts and ethical dilemmas. The simulation includes resource management, diplomacy, military strategy, and ethical considerations. Allow for a degree of freedom by the player to drive the narrative.

Core Values Framework

  1. Constitutional Perspective (guides "good" characters):
    • Human rights and dignity
    • Justice and fairness
  • Civil freedoms
var globals = {
thingWeNeedClasses: undefined
};
require(["/Scripts/ThingWeNeed.js",
function (thingWeNeedClasses) {
globals.thingweNeedClasses = thingWeNeedClasses;
});
function doStuff() {
@jaypeeZero
jaypeeZero / blah.cs
Last active December 19, 2015 00:09
public void UpdateObjectChangesIfChanged<TEntity>(TEntity entity) where TEntity : EntityObject
{
// Run Audit Log code
this.SavingChangesAction = new Action<ObjectContext>(AuditTableLogAction<T>);
//this.ObjectContext.ObjectStateManager.ChangeObjectState(entity, EntityState.Modified);
this.ObjectContext.SaveChanges();
}
public void UpdateObjectChanges<TEntity>(TEntity entity) where TEntity : EntityObject
{
@jaypeeZero
jaypeeZero / bind.js
Created April 25, 2013 16:59
Stolen directly from Underscore.js
var CR = {
bind: function (func, context) {
var nativeBind = Function.prototype.bind,
slice = Array.prototype.slice,
args,
bound,
ctor = function () {};
if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
if (!hb.isFunction(func)) throw new TypeError;
window.cr = window.cr || {
func1: function () {
console.log("Test this");
}
}
<script type="text/javascript" src="http://example.com/jquery-1.7.2.js"></script>
<script type="text/javascript">
var $j = $.noConflict(true);
</script>
<!-- load jQuery 1.3.2 -->
<script type="text/javascript" src="http://example.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
var $j19 = $.noConflict(true);
</script>
@jaypeeZero
jaypeeZero / less.less
Created March 6, 2013 18:04
Add this to your .LESS file
.bigModal{
position:fixed;
top:50%;
left:50%;
z-index:1050;
width:940px;
margin:-250px 0 0 -280px;
margin-left:-470px;
background-color:#fff;
border:1px solid #999;
public partial class MyWebPage {
public void SomeMethod() {
var imaginaryValues = /* Some long string array of values */
Page.GetWebValueControls().ForEach(c => {
c._getOrSetControlValue(true, imaginaryValues[THE_CORRECT_INDEX]);
});
}
}
public static class Extensions {
public static IEnumerable<T> Descendants<T>(this IEnumerable<T> source, Func<T, IEnumerable<T>> DescendBy) {
foreach (T value in source) {
yield return value;
foreach (T child in DescendBy(value).Descendants<T>(DescendBy)) {
yield return child;
}
}
}
var Coin = Backbone.Model.extend({
defaults: {
value: 0,
image: ''
}
});
var Coins = Backbone.Collection.extend({
model: Coin,